Class PathElement2d.ArcPathElement2d
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d2.d.PathElement2d
-
- org.arakhne.afc.math.geometry.d2.d.PathElement2d.ArcPathElement2d
-
- All Implemented Interfaces:
Serializable,Cloneable,PathElement2afp,PathElement2D
- Enclosing class:
- PathElement2d
static class PathElement2d.ArcPathElement2d extends PathElement2d
An element of the path that represents aArc_TO.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.arakhne.afc.math.geometry.d2.d.PathElement2d
PathElement2d.ArcPathElement2d, PathElement2d.ClosePathElement2d, PathElement2d.CurvePathElement2d, PathElement2d.LinePathElement2d, PathElement2d.MovePathElement2d, PathElement2d.QuadPathElement2d
-
-
Field Summary
-
Fields inherited from class org.arakhne.afc.math.geometry.d2.d.PathElement2d
toX, toY, type
-
-
Constructor Summary
Constructors Constructor Description ArcPathElement2d(double fromx, double fromy, double tox, double toy, double xradius, double yradius, double xrotation, boolean largeArcFlag, boolean sweepFlag)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)doublegetFromX()Replies the x coordinate of the starting point.doublegetFromY()Replies the y coordinate of the starting point.booleangetLargeArcFlag()Replies if the arc-to will sweep clockwise around the ellipse.doublegetRadiusX()Replies the x radius of the arc-to ellipse.doublegetRadiusY()Replies the y radius of the arc-to ellipse.doublegetRotationX()Replies the rotation of the x axis of the arc-to ellipse.booleangetSweepFlag()Replies if the arc-to will sweep the long way around the ellipse.inthashCode()booleanisDrawable()Replies if the element is not empty and is drawable.booleanisEmpty()Replies if the element is empty, ie. the points are the same.double[]toArray()Copy the coords into an array, except the source point.voidtoArray(double[] array)Copy the coords into the given array, except the source point.voidtoArray(int[] array)Copy the coords into the given array, except the source point.
-
-
-
Constructor Detail
-
ArcPathElement2d
ArcPathElement2d(double fromx, double fromy, double tox, double toy, double xradius, double yradius, double xrotation, boolean largeArcFlag, boolean sweepFlag)Constructor.- Parameters:
fromx- x coordinate of the origin point.fromy- y coordinate of the origin point.tox- x coordinate of the target point.toy- y coordinate of the target point.xradius- radius of the ellipse along its x axis.yradius- radius of the ellipse along its y axis.xrotation- rotation (in radians) of the ellipse's x axis.largeArcFlag-trueiff the path will sweep the long way around the ellipse.sweepFlag-trueiff the path will sweep clockwise around the ellipse.
-
-
Method Detail
-
equals
@Pure public boolean equals(Object obj)
- Specified by:
equalsin classPathElement2d
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCodein classPathElement2d
-
isEmpty
@Pure public boolean isEmpty()
Description copied from interface:PathElement2DReplies if the element is empty, ie. the points are the same.- Returns:
trueif the points are the same; otherwisefalse.
-
isDrawable
@Pure public boolean isDrawable()
Description copied from interface:PathElement2DReplies if the element is not empty and is drawable.Only the path elements that may produce pixels on the screen must reply
truein this function.- Returns:
trueif the path element is drawable; otherwisefalse.
-
toArray
public void toArray(int[] array)
Description copied from interface:PathElement2afpCopy the coords into the given array, except the source point.- Parameters:
array- the output array.
-
toArray
public void toArray(double[] array)
Description copied from interface:PathElement2afpCopy the coords into the given array, except the source point.- Parameters:
array- the output array.
-
toArray
@Pure public double[] toArray()
Description copied from class:PathElement2dCopy the coords into an array, except the source point.- Specified by:
toArrayin classPathElement2d- Returns:
- the array of the points, except the source point.
-
getFromX
public double getFromX()
Description copied from interface:PathElement2afpReplies the x coordinate of the starting point.- Returns:
- the x coordinate, or
0if the type isPathElementType.MOVE_TO.
-
getFromY
public double getFromY()
Description copied from interface:PathElement2afpReplies the y coordinate of the starting point.- Returns:
- the y coordinate, or
0if the type isPathElementType.MOVE_TO.
-
getRadiusX
public double getRadiusX()
Description copied from interface:PathElement2afpReplies the x radius of the arc-to ellipse.- Specified by:
getRadiusXin interfacePathElement2afp- Overrides:
getRadiusXin classPathElement2d- Returns:
- the x radius, or
0if the type is notPathElementType.ARC_TO.
-
getRadiusY
public double getRadiusY()
Description copied from interface:PathElement2afpReplies the y radius of the arc-to ellipse.- Specified by:
getRadiusYin interfacePathElement2afp- Overrides:
getRadiusYin classPathElement2d- Returns:
- the y radius, or
0if the type is notPathElementType.ARC_TO.
-
getRotationX
public double getRotationX()
Description copied from interface:PathElement2afpReplies the rotation of the x axis of the arc-to ellipse.- Specified by:
getRotationXin interfacePathElement2afp- Overrides:
getRotationXin classPathElement2d- Returns:
- the x axis rotation, or
0if the type is notPathElementType.ARC_TO.
-
getSweepFlag
public boolean getSweepFlag()
Description copied from interface:PathElement2afpReplies if the arc-to will sweep the long way around the ellipse.- Specified by:
getSweepFlagin interfacePathElement2afp- Overrides:
getSweepFlagin classPathElement2d- Returns:
trueiff the element will sweep clockwise around the ellipse, or0if the type is notPathElementType.ARC_TO.
-
getLargeArcFlag
public boolean getLargeArcFlag()
Description copied from interface:PathElement2afpReplies if the arc-to will sweep clockwise around the ellipse.- Specified by:
getLargeArcFlagin interfacePathElement2afp- Overrides:
getLargeArcFlagin classPathElement2d- Returns:
trueiff the element will sweep clockwise around the ellipse, or0if the type is notPathElementType.ARC_TO.
-
-