libnxter  0.1
Functions
Circle.nxc File Reference

Circle geometry operations. More...

#include "Debug.nxc"
#include "Vector.nxc"
Include dependency graph for Circle.nxc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool CircleIntersectCircle (Vector &circleACenter, long circleARadius, Vector &circleBCenter, long circleBRadius, Vector &retIntersect1, Vector &retIntersect2)
 Determins the 2 points of intersection of two overlapping circles. More...
 
bool CircleIntersectLine (Vector &circle, long radius, Vector &pointA, Vector &pointB, Vector &retIntersect1, Vector &retIntersect2)
 Determins the 2 points of intersection of a circle and a line given by two vector points. More...
 

Detailed Description

Circle geometry operations.

Definition in file Circle.nxc.

Function Documentation

bool CircleIntersectCircle ( Vector circleACenter,
long  circleARadius,
Vector circleBCenter,
long  circleBRadius,
Vector retIntersect1,
Vector retIntersect2 
)

Determins the 2 points of intersection of two overlapping circles.

It returns true if the circles intersect uniquely. It returns false if the circles do not intersect (no solution) or they overlap (no unique solution). The two points of intersection are returned in retIntersect1 and retIntersect2. Ref: http://local.wasp.uwa.edu.au/~pbourke/geometry/2circle/

Definition at line 45 of file Circle.nxc.

References VectorAdd(), VectorGetDistanceVec(), VectorReduce(), VectorScale(), VectorSubtract(), Vector::x, and Vector::y.

Referenced by SonarTriangulateLandmarks().

bool CircleIntersectLine ( Vector circle,
long  radius,
Vector pointA,
Vector pointB,
Vector retIntersect1,
Vector retIntersect2 
)

Determins the 2 points of intersection of a circle and a line given by two vector points.

It returns true if the line and circle intersect uniquely. It returns false if they do not intersect (no solution). The two points of intersection are returned in retIntersect1 and retIntersect2. If there is only one intersection point (line just touches the circle, both vectors return the same point. Ref: http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/

Definition at line 99 of file Circle.nxc.

References VectorAdd(), VectorGetDistanceVec(), VectorReduce(), VectorSubtract(), Vector::x, and Vector::y.

Referenced by VehicleGetLookahead().