Cody

Problem 1387. Points on a circle.

This problem is related to 1283, Points on a Sphere. In this case, instead of a sphere, you have a circle. Given a radius R, calculate the number of points on the circumference of the circle that have two integer coordinates. For a circle of radius 5, you would have 12 points:

  • (0, 5) and (0, -5)
  • (5, 0) and (-5, 0)
  • (2, 1) and (2, -1)
  • (-2, 1) and (-2, -1)
  • (1, 2) and (1, -2)
  • (-1, 2) and (-1, -2)

Some radii are quite large, so watch out. Good luck!

Solution Stats

39.58% Correct | 60.42% Incorrect
Last solution submitted on Aug 10, 2016

Problem Comments

Solution Comments

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more