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)
Description:
Fills all the fields of the SG_CIRCLE structure with the arguments.
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)
Description:
Creates a circle in the space by three points.
Arguments:
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
Description:
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.
Arguments:
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:
SG_POINT SG_VECTOR sgCCircle SG_DRAW_LINE_FUNC