java.lang.Object
java.lang.Record
org.jhotdraw8.geom.biarc.Arc
- Record Components:
c- Center point.r- Radius.startAngle- Start angle in radian.sweepAngle- Sweep angle in radian.p1- Start point of the arc.p2- End point of the arc.
public record Arc(Point2D.Double c, double r, double startAngle, double sweepAngle, Point2D.Double p1, Point2D.Double p2)
extends Record
Definition of an Arc. It contains redundant information.
-
Constructor Summary
ConstructorsConstructorDescriptionArc(Point2D.Double c, double r, double startAngle, double sweepAngle, Point2D.Double p1, Point2D.Double p2) Creates an instance of aArcrecord class. -
Method Summary
Modifier and TypeMethodDescriptionc()Returns the value of thecrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanOrientation of the arc.doublelength()p1()Returns the value of thep1record component.p2()Returns the value of thep2record component.pointAt(double t) Implements the parametric equation.doubler()Returns the value of therrecord component.doubleReturns the value of thestartAnglerecord component.doubleReturns the value of thesweepAnglerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Arc
public Arc(Point2D.Double c, double r, double startAngle, double sweepAngle, Point2D.Double p1, Point2D.Double p2) Creates an instance of aArcrecord class.- Parameters:
c- the value for thecrecord componentr- the value for therrecord componentstartAngle- the value for thestartAnglerecord componentsweepAngle- the value for thesweepAnglerecord componentp1- the value for thep1record componentp2- the value for thep2record component
-
-
Method Details
-
isClockwise
public boolean isClockwise()Orientation of the arc. -
pointAt
Implements the parametric equation.- Parameters:
t- Parameter of the curve. Must be in [0,1]- Returns:
- the point at t
-
length
public double length() -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
c
Returns the value of thecrecord component.- Returns:
- the value of the
crecord component
-
r
public double r()Returns the value of therrecord component.- Returns:
- the value of the
rrecord component
-
startAngle
public double startAngle()Returns the value of thestartAnglerecord component.- Returns:
- the value of the
startAnglerecord component
-
sweepAngle
public double sweepAngle()Returns the value of thesweepAnglerecord component.- Returns:
- the value of the
sweepAnglerecord component
-
p1
Returns the value of thep1record component.- Returns:
- the value of the
p1record component
-
p2
Returns the value of thep2record component.- Returns:
- the value of the
p2record component
-