math.geom2d.conic
Class CircleArc2D

Package class diagram package CircleArc2D
java.lang.Object
  extended by math.geom2d.curve.AbstractContinuousCurve2D
      extended by math.geom2d.curve.AbstractSmoothCurve2D
          extended by math.geom2d.conic.EllipseArc2D
              extended by math.geom2d.conic.CircleArc2D
All Implemented Interfaces:
Serializable, Cloneable, CirculinearContinuousCurve2D, CirculinearCurve2D, CirculinearElement2D, CirculinearShape2D, ContinuousCirculinearCurve2D, CircularShape2D, ContinuousCurve2D, Curve2D, SmoothCurve2D, ContinuousOrientedCurve2D, OrientedCurve2D, SmoothOrientedCurve2D, Shape2D

public class CircleArc2D
extends EllipseArc2D
implements Cloneable, CircularShape2D, CirculinearElement2D

A circle arc, defined by the center and the radius of the containing circle, by a starting angle, and by a (signed) angle extent.

A circle arc is directed: if angle extent is positive, the arc is counter clockwise. Otherwise, it is clockwise.

A circle arc is parameterized using angle from center. The arc contains all points with a parametric equation of t, for each t between 0 and the angle extent.

Author:
dlegland
See Also:
Serialized Form

Field Summary
protected  Circle2D circle
           
 
Fields inherited from class math.geom2d.conic.EllipseArc2D
angleExtent, ellipse, startAngle
 
Fields inherited from interface math.geom2d.Shape2D
ACCURACY
 
Constructor Summary
CircleArc2D()
          Create a circle arc whose support circle is centered on (0,0) and has a radius equal to 1.
CircleArc2D(Circle2D circle, double startAngle, double angleExtent)
          create a new circle arc based on an already existing circle.
CircleArc2D(Circle2D circle, double startAngle, double endAngle, boolean direct)
          create a new circle arc based on an already existing circle, specifying if arc is direct or not.
CircleArc2D(double xc, double yc, double r, double start, double extent)
          Base constructor with all parameters specified
CircleArc2D(double xc, double yc, double r, double start, double end, boolean direct)
          Base constructor, for constructiong arc from circle parameters, start and end angles, and by specifying whether arc is direct or not.
CircleArc2D(Point2D center, double radius, double startAngle, double angleExtent)
          Create a new circle arc with specified point center and radius
CircleArc2D(Point2D center, double radius, double start, double end, boolean direct)
          Create a new circle arc with specified point center and radius, start and end angles, and by specifying whether arc is direct or not.
 
Method Summary
 CurveSet2D<CircleArc2D> clip(Box2D box)
          Clip the circle arc by a box.
 CircleArc2D clone()
          Overrides Object declaration to ensure Curve2D implementation are cloned as Curve2D.
 boolean contains(double x, double y)
          Checks if the shape contains the planar point defined by (x,y).
 boolean contains(Point2D p)
          Checks if the shape contains the given point.
static CircleArc2D create(Circle2D support, double startAngle, double angleExtent)
           
static CircleArc2D create(Circle2D support, double startAngle, double endAngle, boolean direct)
           
static CircleArc2D create(Point2D center, double radius, double startAngle, double angleExtent)
           
static CircleArc2D create(Point2D center, double radius, double startAngle, double endAngle, boolean direct)
           
 boolean equals(Object obj)
          Two circle arc are equal if the have same center, same radius, same starting and ending angles, and same orientation.
 CirculinearDomain2D getBuffer(double dist)
          Computes the buffer of the shape, formed by the set of points located at a distance from the shape that is lower or equal to d.
 Collection<? extends CircleArc2D> getContinuousCurves()
          Returns the collection of continuous curves which constitute this curve.
 double getDistance(double x, double y)
          get the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e.
 double getDistance(Point2D p)
          get the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape.
 Collection<Point2D> getIntersections(LinearShape2D line)
          Compute intersections of the circle arc with a line.
 double getLength()
           
 double getLength(double pos)
           
 CircleArc2D getParallel(double dist)
          Creates a new curve, formed by the points with parameterization: p(t) = c(t) + d*n(t)/|n(t)|, with p(t) being a point of the original curve, n(t) the normal of the curve, and |n| being the norm of n.
In the case of a continuous curve formed by several smooth circulinear elements, the parallels of contiguous elements are joined by a circle arc.
 Point2D getPoint(double t)
          Returns the position of a point form the curvilinear position.
 double getPosition(double length)
           
 double getPosition(Point2D point)
          return relative position between 0 and the angle extent.
 CircleArc2D getReverseCurve()
          Returns the circle arc which refers to the same parent circle, with same start angle, and with opposite angle extent.
 double getSignedDistance(double x, double y)
          The same as getSignedDistance(Point2D), but by passing 2 double as arguments.
 double getSignedDistance(Point2D p)
          Get the signed distance of the curve to the given point: this distance is positive if the point lies outside the shape, and is negative if the point lies inside the shape.
 Collection<? extends CircleArc2D> getSmoothPieces()
          Returns a set of smooth curves.
 CircleArc2D getSubCurve(double t0, double t1)
          return a new CircleArc2D.
 Circle2D getSupportCircle()
          Deprecated. use getSupportingCircle instead
 Circle2D getSupportingCircle()
          Returns the circle which contains the circle arc.
 double getT0()
          Always return 0
 double getT1()
          return the last position of the circle are, which is given by the angle extent of the arc.
 Vector2D getTangent(double t)
           
 double getWindingAngle(Point2D point)
          Return the angle portion that the curve turn around the given point.
 boolean isBounded()
          Always return true
 boolean isClosed()
          a circle arc is never closed by definition.
 boolean isInside(Point2D point)
          Returns true if the point is 'inside' the domain bounded by the curve.
 double project(Point2D point)
          Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point.
 void setArc(Point2D center, double radius, double start, double extent)
          Deprecated. conics will become imutable in a future release
 void setCenter(Point2D point)
          Deprecated. conics will become imutable in a future release
 void setRadius(double r)
          Deprecated. conics will become imutable in a future release
 String toString()
           
 EllipseArc2D transform(AffineTransform2D trans)
          Returns an instance of EllipseArc2D, or CircleArc2D if transform is a similarity.
 CirculinearElement2D transform(CircleInversion2D inv)
          Transforms the shape by a circle inversion.
 
Methods inherited from class math.geom2d.conic.EllipseArc2D
appendPath, containsAngle, create, create, draw, getAngle, getAngleExtent, getBoundingBox, getCurvature, getGeneralPath, getStartAngle, getSupportingEllipse, isDirect, isEmpty
 
Methods inherited from class math.geom2d.curve.AbstractSmoothCurve2D
getLeftTangent, getRightTangent, getSingularPoints, isSingular
 
Methods inherited from class math.geom2d.curve.AbstractContinuousCurve2D
getAsAWTShape, getAsPolyline, getFirstPoint, getLastPoint, wrapCurve
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface math.geom2d.curve.ContinuousCurve2D
appendPath, getAsPolyline, getLeftTangent, getRightTangent
 
Methods inherited from interface math.geom2d.curve.Curve2D
draw, getAsAWTShape, getFirstPoint, getLastPoint, getSingularPoints, isSingular
 
Methods inherited from interface math.geom2d.Shape2D
getBoundingBox, isEmpty
 
Methods inherited from interface math.geom2d.curve.SmoothCurve2D
getCurvature
 

Field Detail

circle

protected Circle2D circle
Constructor Detail

CircleArc2D

public CircleArc2D()
Create a circle arc whose support circle is centered on (0,0) and has a radius equal to 1. Start angle is 0, and angle extent is PI/2.


CircleArc2D

public CircleArc2D(Circle2D circle,
                   double startAngle,
                   double angleExtent)
create a new circle arc based on an already existing circle.


CircleArc2D

public CircleArc2D(Circle2D circle,
                   double startAngle,
                   double endAngle,
                   boolean direct)
create a new circle arc based on an already existing circle, specifying if arc is direct or not.


CircleArc2D

public CircleArc2D(Point2D center,
                   double radius,
                   double startAngle,
                   double angleExtent)
Create a new circle arc with specified point center and radius


CircleArc2D

public CircleArc2D(Point2D center,
                   double radius,
                   double start,
                   double end,
                   boolean direct)
Create a new circle arc with specified point center and radius, start and end angles, and by specifying whether arc is direct or not.


CircleArc2D

public CircleArc2D(double xc,
                   double yc,
                   double r,
                   double start,
                   double end,
                   boolean direct)
Base constructor, for constructiong arc from circle parameters, start and end angles, and by specifying whether arc is direct or not.


CircleArc2D

public CircleArc2D(double xc,
                   double yc,
                   double r,
                   double start,
                   double extent)
Base constructor with all parameters specified

Method Detail

create

public static CircleArc2D create(Circle2D support,
                                 double startAngle,
                                 double angleExtent)

create

public static CircleArc2D create(Circle2D support,
                                 double startAngle,
                                 double endAngle,
                                 boolean direct)

create

public static CircleArc2D create(Point2D center,
                                 double radius,
                                 double startAngle,
                                 double angleExtent)

create

public static CircleArc2D create(Point2D center,
                                 double radius,
                                 double startAngle,
                                 double endAngle,
                                 boolean direct)

getSupportCircle

@Deprecated
public Circle2D getSupportCircle()
Deprecated. use getSupportingCircle instead

Returns the circle which contains the circle arc.


setCenter

@Deprecated
public void setCenter(Point2D point)
Deprecated. conics will become imutable in a future release

Change the center of the support circle.

Parameters:
point - the new center of the arc.

setRadius

@Deprecated
public void setRadius(double r)
Deprecated. conics will become imutable in a future release

Change the radius of the support circle

Parameters:
r - the new radius

setArc

@Deprecated
public void setArc(Point2D center,
                              double radius,
                              double start,
                              double extent)
Deprecated. conics will become imutable in a future release


getSupportingCircle

public Circle2D getSupportingCircle()
Returns the circle which contains the circle arc.

Specified by:
getSupportingCircle in interface CircularShape2D

getBuffer

public CirculinearDomain2D getBuffer(double dist)
Description copied from interface: CirculinearShape2D
Computes the buffer of the shape, formed by the set of points located at a distance from the shape that is lower or equal to d.

Specified by:
getBuffer in interface CirculinearShape2D
Parameters:
dist - the maximal distance between a point of the buffer and the shape
Returns:
the buffer of the shape

getParallel

public CircleArc2D getParallel(double dist)
Description copied from interface: CirculinearCurve2D
Creates a new curve, formed by the points with parameterization: p(t) = c(t) + d*n(t)/|n(t)|, with p(t) being a point of the original curve, n(t) the normal of the curve, and |n| being the norm of n.
In the case of a continuous curve formed by several smooth circulinear elements, the parallels of contiguous elements are joined by a circle arc.

Specified by:
getParallel in interface CirculinearContinuousCurve2D
Specified by:
getParallel in interface CirculinearCurve2D
Specified by:
getParallel in interface CirculinearElement2D
Specified by:
getParallel in interface ContinuousCirculinearCurve2D
Parameters:
dist - the distance between the original curve and he parallel curve.
Returns:
the parallel curve

getLength

public double getLength()
Specified by:
getLength in interface CirculinearCurve2D
Returns:
the length of the curve

getLength

public double getLength(double pos)
Specified by:
getLength in interface CirculinearCurve2D
Returns:
the length from the beginning to the position given by pos

getPosition

public double getPosition(double length)
Specified by:
getPosition in interface CirculinearCurve2D
Returns:
the position located at distance 'length' from the origin

transform

public CirculinearElement2D transform(CircleInversion2D inv)
Description copied from interface: CirculinearShape2D
Transforms the shape by a circle inversion. The result is still an instance a CirculinearShape2D.

Specified by:
transform in interface CirculinearContinuousCurve2D
Specified by:
transform in interface CirculinearCurve2D
Specified by:
transform in interface CirculinearElement2D
Specified by:
transform in interface CirculinearShape2D
Specified by:
transform in interface ContinuousCirculinearCurve2D
Parameters:
inv - the circle inversion
Returns:
the transformed shape

getWindingAngle

public double getWindingAngle(Point2D point)
Description copied from interface: OrientedCurve2D
Return the angle portion that the curve turn around the given point. Result is a signed angle.

Specified by:
getWindingAngle in interface OrientedCurve2D
Overrides:
getWindingAngle in class EllipseArc2D
Parameters:
point - a point of the plane
Returns:
a signed angle

isInside

public boolean isInside(Point2D point)
Description copied from interface: OrientedCurve2D
Returns true if the point is 'inside' the domain bounded by the curve.

Specified by:
isInside in interface OrientedCurve2D
Overrides:
isInside in class EllipseArc2D
Parameters:
point - a point in the plane
Returns:
true if the point is on the left side of the curve.

getSignedDistance

public double getSignedDistance(Point2D p)
Description copied from interface: OrientedCurve2D
Get the signed distance of the curve to the given point: this distance is positive if the point lies outside the shape, and is negative if the point lies inside the shape. In this case, absolute value of distance is equals to the distance to the border of the shape.

Specified by:
getSignedDistance in interface OrientedCurve2D
Overrides:
getSignedDistance in class EllipseArc2D
Parameters:
p - a point of the plane
Returns:
the signed distance to the curve

getSignedDistance

public double getSignedDistance(double x,
                                double y)
Description copied from interface: OrientedCurve2D
The same as getSignedDistance(Point2D), but by passing 2 double as arguments.

Specified by:
getSignedDistance in interface OrientedCurve2D
Overrides:
getSignedDistance in class EllipseArc2D
Parameters:
x - x-coord of a point
y - y-coord of a point
Returns:
the signed distance of the point (x,y) to the curve

getTangent

public Vector2D getTangent(double t)
Specified by:
getTangent in interface SmoothCurve2D
Overrides:
getTangent in class EllipseArc2D

getSmoothPieces

public Collection<? extends CircleArc2D> getSmoothPieces()
Description copied from interface: ContinuousCurve2D
Returns a set of smooth curves.

Specified by:
getSmoothPieces in interface CirculinearContinuousCurve2D
Specified by:
getSmoothPieces in interface ContinuousCirculinearCurve2D
Specified by:
getSmoothPieces in interface ContinuousCurve2D
Overrides:
getSmoothPieces in class AbstractSmoothCurve2D

isClosed

public boolean isClosed()
a circle arc is never closed by definition.

Specified by:
isClosed in interface ContinuousCurve2D
Overrides:
isClosed in class EllipseArc2D

getT0

public double getT0()
Always return 0

Specified by:
getT0 in interface Curve2D
Overrides:
getT0 in class EllipseArc2D

getT1

public double getT1()
return the last position of the circle are, which is given by the angle extent of the arc.

Specified by:
getT1 in interface Curve2D
Overrides:
getT1 in class EllipseArc2D

getPoint

public Point2D getPoint(double t)
Returns the position of a point form the curvilinear position.

Specified by:
getPoint in interface Curve2D
Overrides:
getPoint in class EllipseArc2D

getPosition

public double getPosition(Point2D point)
return relative position between 0 and the angle extent.

Specified by:
getPosition in interface Curve2D
Overrides:
getPosition in class EllipseArc2D
Parameters:
point - a point belonging to the curve
Returns:
the position of the point on the curve

getIntersections

public Collection<Point2D> getIntersections(LinearShape2D line)
Compute intersections of the circle arc with a line. Return an array of Point2D, of size 0, 1 or 2 depending on the distance between circle and line. If there are 2 intersections points, the first one in the array is the first one on the line.

Specified by:
getIntersections in interface Curve2D
Overrides:
getIntersections in class EllipseArc2D

project

public double project(Point2D point)
Description copied from interface: Curve2D
Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point. This function should always returns a valid value.

Specified by:
project in interface Curve2D
Overrides:
project in class EllipseArc2D
Parameters:
point - a point to project
Returns:
the position of the closest orthogonal projection

getDistance

public double getDistance(Point2D p)
Description copied from interface: Shape2D
get the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape.

Specified by:
getDistance in interface Shape2D
Overrides:
getDistance in class EllipseArc2D

getDistance

public double getDistance(double x,
                          double y)
Description copied from interface: Shape2D
get the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e. fillable) shape.

Specified by:
getDistance in interface Shape2D
Overrides:
getDistance in class EllipseArc2D

isBounded

public boolean isBounded()
Always return true

Specified by:
isBounded in interface Shape2D
Overrides:
isBounded in class EllipseArc2D

getSubCurve

public CircleArc2D getSubCurve(double t0,
                               double t1)
return a new CircleArc2D. Variables t0 and t1 must be comprised between 0 and the angle extent of the arc.

Specified by:
getSubCurve in interface CirculinearContinuousCurve2D
Specified by:
getSubCurve in interface CirculinearCurve2D
Specified by:
getSubCurve in interface CirculinearElement2D
Specified by:
getSubCurve in interface ContinuousCirculinearCurve2D
Specified by:
getSubCurve in interface CircularShape2D
Specified by:
getSubCurve in interface ContinuousCurve2D
Specified by:
getSubCurve in interface Curve2D
Specified by:
getSubCurve in interface SmoothCurve2D
Specified by:
getSubCurve in interface ContinuousOrientedCurve2D
Specified by:
getSubCurve in interface SmoothOrientedCurve2D
Overrides:
getSubCurve in class EllipseArc2D
Parameters:
t0 - position of the start of the sub-curve
t1 - position of the end of the sub-curve
Returns:
the portion of original curve comprised between t0 and t1.

getReverseCurve

public CircleArc2D getReverseCurve()
Returns the circle arc which refers to the same parent circle, with same start angle, and with opposite angle extent.

Specified by:
getReverseCurve in interface CirculinearContinuousCurve2D
Specified by:
getReverseCurve in interface CirculinearCurve2D
Specified by:
getReverseCurve in interface CirculinearElement2D
Specified by:
getReverseCurve in interface ContinuousCirculinearCurve2D
Specified by:
getReverseCurve in interface CircularShape2D
Specified by:
getReverseCurve in interface ContinuousCurve2D
Specified by:
getReverseCurve in interface Curve2D
Specified by:
getReverseCurve in interface SmoothCurve2D
Specified by:
getReverseCurve in interface ContinuousOrientedCurve2D
Specified by:
getReverseCurve in interface OrientedCurve2D
Specified by:
getReverseCurve in interface SmoothOrientedCurve2D
Overrides:
getReverseCurve in class EllipseArc2D

getContinuousCurves

public Collection<? extends CircleArc2D> getContinuousCurves()
Description copied from interface: Curve2D
Returns the collection of continuous curves which constitute this curve.

Specified by:
getContinuousCurves in interface CirculinearCurve2D
Specified by:
getContinuousCurves in interface Curve2D
Overrides:
getContinuousCurves in class EllipseArc2D
Returns:
a collection of continuous curves.

clip

public CurveSet2D<CircleArc2D> clip(Box2D box)
Clip the circle arc by a box. The result is a CurveSet2D, which contains only instances of CircleArc2D. If circle arc is not clipped, the result is an instance of CurveSet2D with zero curves.

Specified by:
clip in interface CirculinearContinuousCurve2D
Specified by:
clip in interface CirculinearCurve2D
Specified by:
clip in interface CirculinearElement2D
Specified by:
clip in interface ContinuousCirculinearCurve2D
Specified by:
clip in interface CircularShape2D
Specified by:
clip in interface ContinuousCurve2D
Specified by:
clip in interface Curve2D
Specified by:
clip in interface SmoothCurve2D
Specified by:
clip in interface ContinuousOrientedCurve2D
Specified by:
clip in interface OrientedCurve2D
Specified by:
clip in interface SmoothOrientedCurve2D
Specified by:
clip in interface Shape2D
Overrides:
clip in class EllipseArc2D
Parameters:
box - the clipping box
Returns:
the clipped shape

transform

public EllipseArc2D transform(AffineTransform2D trans)
Returns an instance of EllipseArc2D, or CircleArc2D if transform is a similarity.

Specified by:
transform in interface ContinuousCurve2D
Specified by:
transform in interface Curve2D
Specified by:
transform in interface SmoothCurve2D
Specified by:
transform in interface ContinuousOrientedCurve2D
Specified by:
transform in interface OrientedCurve2D
Specified by:
transform in interface SmoothOrientedCurve2D
Specified by:
transform in interface Shape2D
Overrides:
transform in class EllipseArc2D
Parameters:
trans - an affine transform
Returns:
the transformed shape

contains

public boolean contains(Point2D p)
Description copied from interface: Shape2D
Checks if the shape contains the given point.

Specified by:
contains in interface Shape2D
Overrides:
contains in class EllipseArc2D

contains

public boolean contains(double x,
                        double y)
Description copied from interface: Shape2D
Checks if the shape contains the planar point defined by (x,y).

Specified by:
contains in interface Shape2D
Overrides:
contains in class EllipseArc2D

toString

public String toString()
Overrides:
toString in class EllipseArc2D

equals

public boolean equals(Object obj)
Two circle arc are equal if the have same center, same radius, same starting and ending angles, and same orientation.

Overrides:
equals in class EllipseArc2D

clone

public CircleArc2D clone()
Description copied from interface: Curve2D
Overrides Object declaration to ensure Curve2D implementation are cloned as Curve2D.

Specified by:
clone in interface Curve2D
Overrides:
clone in class EllipseArc2D
Returns:
the cloned curve


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.