SG_CIRCLE structure


The SG_CIRCLE structure is a circle representaion in three-dimesional space.


Has the following fields


double radius;  - circle radius

SG_VECTOR  normal; - normal to a circle surface

SG_POINT center; - circle center


Has the following methods:


bool   FromCenterRadiusNormal(const SG_POINT& cen, double rad, const SG_VECTOR& nor)



Fills all the fields of the SG_CIRCLE structure with the arguments.



cen - circle center,

rad - circle radius,

nor - normal to a surface


Returned value:

In case of a zero-radius or if normal to a surface length is zero returns false, otherwise - true


bool FromThreePoints(const SG_POINT& p1, const SG_POINT& p2, const SG_POINT& p3)



Creates a circle in the space by three points.


p1 - first circle point,

p2 - second circle point,

p3 - third circle point,


Returned value:

In case the points coinsides or lies on the same line returns false, otherwise - true


bool Draw(SG_DRAW_LINE_FUNC line_func) const



For each line of the segment circle presentation it calls the line_func function.

Enables you to quickly construct a circle without creating a sgCCircle object.


line_func - pointer to the function called for each line of a segment circle presentation


Returned value:

In case of a zero argument returns false, otherwise - true.



Defined in sg2D.h


See also: