|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sflmath.h" int point_in_circle (const FPOINT *point, const FPOINT *coords)
Checks if the requested FPOINT is within the specified circle. Returns TRUE or FALSE appropriately.
{
double
circle_radius,
distance_from_centre;
circle_radius = ((coords [0].y - coords [1].y) *
(coords [0].y - coords [1].y)) +
((coords [0].x - coords [1].x) *
(coords [0].x - coords [1].x));
distance_from_centre = ((coords [0].y - point-> y) *
(coords [0].y - point-> y)) +
((coords [0].x - point-> x) *
(coords [0].x - point-> x));
return (distance_from_centre <= circle_radius);
}
| | << | < | > | >> |
|