Refer to the
description
The matrix defines the orientation of the plane in which the conic lies,
in the same manner as the matrix for an arc. The X axis of the matrix
determines the orientation of angle zero.
A point on the conic (in the XY plane) is given by
For ellipse:
X = k1 cos (t)
Y = k2 sin (t)
For parabola:
X = t2 / k1
Y = t
For hyperbola:
X = k1 / cos (t)
Y = k2 sin (t) / cos (t)
where t is the parameter value.
NOTE that for an ellipse, the parameter values are NOT angles.
For a given parameter value, t, the angle (in radians) is the inverse
tangent (arctan) of Y/X. For angles between 0 and pi/2 the following
equation can be used to determine ellipse parameter values:
t = arctan( (k1 / k2) tan(angle) )
The parameter value returned must be adjusted when the angles are in
the pi/2 to 2pi range.
For example to find the correct conic_data.start_param to correspond to
a given ellipse start_angle in degrees:
conic_data.start_param = atan( (conic_data.k1 / conic_data.k2)
tan( DEGRA start_angle) );
modf((start_angle + 90)/180, &n_adj);
conic_data.start_param = (n_adj PI) + conic_data.start_param;