Bit Focus

Circles Intersection

We are going to calculate points of intersections for 2 circels, given their centers and radiuses on a 2D plane. Say, we will implement the following C function
int intersect(struct circle_t const circles[], struct point_t intersections[]);
where point_t and circle_t are
struct point_t {
    double x;
    double y;

struct circle_t {
    point_t center;
    double r;
    The function intersect takes 2 circles as parameter, returns the number of points of intersection, and the details of the points will be put in parameter intersection. Since 2 circles may have up to 2 points of intersection, we may call that function in following way:

Permanent Link: /p/0 Load full text

Post tags:


0 Page 1

. Back to Bit Focus
NijiPress - Copyright (C) Neuron Teckid @ Bit Focus
About this site