Circle Functions |
|
Circle Functions SupportThe Fractal Science Kit fractal generator Circle functions are associated with the Circle object: Object Circle { The Circle object can, in fact, represent either a line or a circle. IsLine is a Boolean that is True if the object represents a line and False if the object represents a circle. If the object represents a circle, Center and Radius are the circle's center and radius, respectively. If the object represents a line, Point is a point on the line and Angle is the angle between the line and the X axis in radians. The following example illustrates how you would define a Circle object using the object's constructor: Circle c = Circle(False, Center, Radius) This example assigns a circle and a line to the variables c and l. The circle is defined by the arguments: Center and Radius, passed to the constructor. The line is defined by the arguments: Point and Angle, passed to the constructor. The first argument to each constructor determines if the object is a line or circle. Circle CircleC(center, radius) These 2 functions are alternate constructors for a Circle object. CircleC creates a circle from the given center and radius. CircleL creates a line from the given point and angle, where point is a point on the line and angle is the angle between the line and the X axis in radians. Circle Circle.Create(z1, z2, z3) Circle.Create returns a Circle given 3 points (z1, z2, and z3) on the circle. Circle.CreateLine returns a line (as a Circle object) given 2 points (z1 and z2) on the line. Circle Circle.OrthogonalToUnitCircle(z0, z1) Circle.OrthogonalToUnitCircle returns the circle that is orthogonal to the unit circle and passes through the 2 points z0 and z1 which must be on or within the unit circle. Circle.OrthogonalToCircle returns the circle that is orthogonal to the circle c and passes through the 2 points z0 and z1 which must be on or within circle c. c can be a line as well. Complex Circle.DistanceTo(Circle c, z) Circle.DistanceTo returns the closest point on c to the point z. Circle.InsideDistance returns the distance from center of circle c to z as a percent of the circle's radius. If c is in fact a line, then 0.25 is returned if z is to the left of the line and 1e32 is returned if z is to the right. Circle.PassesThru returns True if z is on the circle c. Circle.IsInside returns True if z is inside c. If c is in fact a line, then True is returned if the point is to the left of the line and False is returned if z is to the right. Circle.Equals returns True is c0 is equal to c1. The above functions handle the case where c, c0 or c1 are a circle or a line. Complex Circle.ReflectPoint(Circle c, z) Circle.ReflectPoint reflects the point z in the circle/line c and returns the resulting point. Circle.ReflectCircle reflects circle/line c in circle/line k and returns the resulting circle/line. ' Circle.ReflectCircles takes as input an array of circles and reflects each circle in each of the others to generate additional circles. The arguments are as described in the above comments. Circle.ReflectCircles returns its results in the arrays result[total], index[total], and level[total]. total is set to the dimension of the returned arrays. |
Copyright © 2004-2019 Ross Hilbert |