void
)const
virtual function: Point get_center (void
)These functions return
center
.
const
function: Point get_focus (const unsigned short s)These functions return
focus0
orfocus1
, depending on the value of s, which must be 0 or 1. If s is not 0 or 1,get_focus()
returnsINVALID_POINT
.
void
)const
function: real get_axis_v (void
)Calculates and returns the value of
axis_h
.
get_axis_v()
first checks if theEllipse
is still elliptical, usingis_elliptical()
(see Ellipse Reference; Querying). Operations such asscale()
andshear()
can cause anEllipse
to become non-elliptical. If this is the case, this function returnsINVALID_REAL
.If the
Ellipse
is still elliptical,axis_v
is recalculated and returned. In the non-const
version,axis_v
is also reset to the new value.
void
)const
function: real get_axis_h (void
)Calculates and returns the value of
axis_h
.
get_axis_h()
first checks if theEllipse
is still elliptical, usingis_elliptical()
(see Ellipse Reference; Querying). Operations such asscale()
andshear()
can cause anEllipse
to become non-elliptical. If this is the case, this function returnsINVALID_REAL
.If the
Ellipse
is still elliptical,axis_h
is recalculated and returned. In the non-const
version,axis_h
is also reset to the new value.
const
virtual function: signed short location (Point p)Returns a value l indicating the location of the
Point
argument p with respect to theEllipse
.Let e stand for the
Ellipse
. The return values are as follows:
- 0
- p lies on the perimeter of e.
- 1
- p lies in the plane of e, within its perimeter.
- -1
- p lies in the plane of e, outside its perimeter.
- -2
- p and e do not lie in the same plane.
- -3
- e is not elliptical, possibly due to having been transformed.
Ellipse e(origin, 3, 5, 45, 15, 3); e.shift(2, 1, 1); Point A = e.get_point(7); cout << e.location(A); -| 0 Point B = center.mediate(e.get_point(2)); cout << e.location(B); -| 1 Point C = center.mediate(e.get_point(2), 1.5); cout << e.location(C); -| -1 Point D = A; D.shift(-2, 0, 4); e.location(D); -| WARNING! In Ellipse::location(): Point doesn't lie in plane of Ellipse. Returning -2. e.scale(1.5, 0, 1.5); e.location(A); -| WARNING! In Ellipse::do_transform(const Transform&): This transformation has made *this non-elliptical! ERROR! In Ellipse::location(): Ellipse is non-elliptical. Returning -3.
![]()
Fig. 164.
const
function: Point angle_point (real angle)Returns a point on the
Ellipse
given an angle. APoint
p is set to the zerothPoint
on theEllipse
and rotated about the line from the center of theEllipse
in the direction of the normal to the plane of theEllipse
. Then, the intersection of the ray from the center through p and the perimeter of theEllipse
is returned.Ellipse e(origin, 6, 4); Point P = e.angle_point(135); current_picture.output(Projections::PARALLEL_X_Z);
![]()
Fig. 165.
[next figure] demonstrates, that the rotation is unfortunately not always in the direction one would prefer. I don't have a solution to this problem yet.
Ellipse e(origin, 6, 4, 90); Point P = e.angle_point(135); Point Q = e.angle_point(-135);
![]()
Fig. 166.