Babylonian spiral: Difference between revisions

Content added Content deleted
(New post.)
m (One line overflowed page width.)
Line 106: Line 106:
std::cout << "The first 40 points of the Babylonian spiral are:" << std::endl;
std::cout << "The first 40 points of the Babylonian spiral are:" << std::endl;
for ( int32_t i = 0, column = 0; i < 40; ++i ) {
for ( int32_t i = 0, column = 0; i < 40; ++i ) {
std::string point_string = "(" + std::to_string(points[i].first) + ", " + std::to_string(points[i].second) + ")";
std::string point_str = "(" + std::to_string(points[i].first) + ", " + std::to_string(points[i].second) + ")";
std::cout << std::setw(10) << point_string;
std::cout << std::setw(10) << point_str;
if ( ++column % 10 == 0 ) {
if ( ++column % 10 == 0 ) {
std::cout << std::endl;
std::cout << std::endl;
Line 122: Line 122:
(5, 9) (7, 17) (13, 23) (21, 26) (28, 21) (32, 13) (32, 4) (31, -5) (29, -14) (24, -22)
(5, 9) (7, 17) (13, 23) (21, 26) (28, 21) (32, 13) (32, 4) (31, -5) (29, -14) (24, -22)
</pre>
</pre>

=={{header|J}}==
=={{header|J}}==