| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

point_in_circle

#include "sflmath.h"
int
point_in_circle (const FPOINT *point, const FPOINT *coords)

Synopsis

Checks if the requested FPOINT is within the specified circle. Returns TRUE or FALSE appropriately.

Source Code - (sflmath.c)

{
    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);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation