ProGAL.geom3d
Class Circle

java.lang.Object
  extended by ProGAL.geom3d.Circle
All Implemented Interfaces:
Shape

public class Circle
extends java.lang.Object
implements Shape

A circle in (x,y,z)-space represented by a center-point, a radius and a normal-vector.


Constructor Summary
Circle(Point center, double radius, Vector normal)
           
Circle(Point p0, Point p1, Point p2)
          Circle in the plane through p0, p1, p2
Circle(Point center, Point through, Vector normal)
          A circle with given center through a given point and with specified normal vector
 
Method Summary
 Point getCenter()
          Get the center of the circle.
static Circle getEquilateralCircle(Point a, Point b)
          Create the equilateral circle of two points.
 java.lang.Double getFirstIntersection(Circle c, Point p, Vector dir)
          returns the smallest rotation angle (direction determined by vector dir) needed to bring point p on this circle to be on the circle c as well.
 java.lang.Double getFirstIntersection(Line line, Point p, Vector dir, J3DScene scene)
          returns the smallest rotation angle (direction determined by vector dir) needed to bring point p on this circle to be on the line l as well.
 Point[] getIntersection(Circle c)
          Intersection of 2 circles in the same plane
 Vector getNormal()
           
 Vector getNormalVector()
          Get the normal of the circle.
 double getRadius()
          Get the radius of the circle.
static void main(java.lang.String[] args)
           
 void toConsole()
          Writes this circle to System.out with 2 decimals precision.
 void toConsole(int dec)
          Writes this circle to System.out with dec decimals precision.
 void toScene(J3DScene scene, double width, int res)
           
 java.lang.String toString()
          Returns a string-representation of this circle formatted with two decimals precision.
 java.lang.String toString(int dec)
          Returns a string-representation of this circle formatted with dec decimals precision.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Circle

public Circle(Point center,
              double radius,
              Vector normal)

Circle

public Circle(Point center,
              Point through,
              Vector normal)
A circle with given center through a given point and with specified normal vector


Circle

public Circle(Point p0,
              Point p1,
              Point p2)
Circle in the plane through p0, p1, p2

Method Detail

getCenter

public Point getCenter()
Get the center of the circle.

Specified by:
getCenter in interface Shape

getRadius

public double getRadius()
Get the radius of the circle.


getNormalVector

public Vector getNormalVector()
Get the normal of the circle.


getNormal

public Vector getNormal()

getEquilateralCircle

public static Circle getEquilateralCircle(Point a,
                                          Point b)
Create the equilateral circle of two points.


toString

public java.lang.String toString()
Returns a string-representation of this circle formatted with two decimals precision.

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(int dec)
Returns a string-representation of this circle formatted with dec decimals precision.


toConsole

public void toConsole()
Writes this circle to System.out with 2 decimals precision.


toConsole

public void toConsole(int dec)
Writes this circle to System.out with dec decimals precision.


getIntersection

public Point[] getIntersection(Circle c)
Intersection of 2 circles in the same plane


getFirstIntersection

public java.lang.Double getFirstIntersection(Line line,
                                             Point p,
                                             Vector dir,
                                             J3DScene scene)
returns the smallest rotation angle (direction determined by vector dir) needed to bring point p on this circle to be on the line l as well. Returns null if there is no intersection or just one intersection.

Returns:

getFirstIntersection

public java.lang.Double getFirstIntersection(Circle c,
                                             Point p,
                                             Vector dir)
returns the smallest rotation angle (direction determined by vector dir) needed to bring point p on this circle to be on the circle c as well. Returns null if there is no intersection or just one intersection.

Returns:

toScene

public void toScene(J3DScene scene,
                    double width,
                    int res)

main

public static void main(java.lang.String[] args)