public abstract class JaxoArcObject extends Jaxo3PointObject
SELECT_P3
GHOST_DASH, GLUON_FREQ, PHOTON_FREQ, SCALAR_DASH
SELECT_DX, SELECT_DY, SELECT_P2
D_FORMAT, GRAY_SCALE_FORMAT, SELECT_NONE, SELECT_P1
Constructor and Description |
---|
JaxoArcObject() |
Modifier and Type | Method and Description |
---|---|
JaxoArrow.Coordinates |
arrowCoordinates()
Returns the coordinates of the arrow of the current object.
|
double |
getArcLength()
Calculates the length of this arc.
|
protected double[] |
getArcParameters()
Returns the parameters for the arc calculated from the three points.
|
java.awt.geom.Point2D.Double |
getArcPoint(double t)
This routine returns an arc point that is t * arcLength away from P1.
|
java.awt.geom.Point2D.Double |
getCenterPoint()
Get the center point of the circle that contains the arc.
|
java.awt.geom.Point2D.Double |
getEquidistantPoint(int i,
int n)
Get equidistant points on the arc.
|
java.awt.geom.Point2D.Float[] |
getEquidistantPoints(int n)
Get equidistant points on the arc.
|
java.awt.geom.Point2D.Double |
getMidArcPoint()
Calculates the point in the middle of the arc.
|
double |
getOpeningAngle()
Calculates the opening angle of this arc.
|
double |
getRadius()
Calculates the radius of this arc.
|
boolean |
isClockwise()
Determines the 'handed-ness' of this arc, ie whether the three points
(in click order) lie in clock- or anti-clockwise direction.
|
boolean |
isCopy(JaxoObject comp)
Determines if this JaxoObject is a copy of the specified one.
|
boolean |
isSingular()
Checks if this arc is singular.
|
void |
paintVisualAid(JaxoGraphics2D g2)
Paints a visual aid for the user during dragging
(moving or resizing) of this JaxoObject.
|
void |
setArcPts(int x1,
int y1,
int x2,
int y2,
int p3,
int q3)
Sets the points of this arc.
|
void |
setState(JaxoObject o)
Restore state to the values of 'o'.
|
protected boolean |
tooSingular(double epsilon)
Tests if the current arc is too close to the singularity
where all three points are aligned and the middle click-point (P2)
is on the outside from the other two.
|
canBeSelected, copyFrom, getGrabbedHandle, getPointCount, getX, getX3, getY, getY3, isOneLine, moveBy, paintHandles, rescaleObject, set3Pts, setX, setX3, setY, setY3, smallestDistanceTo
arrowPositionIs, copy, copyFrom, dashIs, dlSepIs, getAmp, getArrow, getArrowPosition, getDash, getDLSeparation, getWiggles, isDoubleLine, isFlip, isPaintArrow, paintArrow, setAmp, setArrow, setArrowPosition, setDash, setDLSeparation, setDoubleLine, setFlip, setPaintArrow, setPreferences, setWiggles
copyFrom, getHeight, getRelh, getRelSize, getRelw, getSize, getStroke, getStrokeWidth, getWidth, getX2, getY2, latexWidth, resetStroke, setLocation, setRadius, setRelativeHeight, setRelativeWidth, setRelWAndH, setStroke, setStrokeWidth, setX2, setY2, strokeIs
addPropertyChangeListener, contains, contains, contains, contains, copyFrom, firePropertyChange, getBounds2D, getBoundsWithHandles, getColor, getGeneralPath, getLaTexLocation, getName, getPathIterator, getPathIterator, getPoints, getX, getY, intersects, intersects, isAround, isMarked, latexCommand, paint, prepareEditPanel, propertyChange, removePropertyChangeListener, setAsMarked, setColor, setLocation, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setPointCount, setPoints, setTransient, setX, setXPosition, setY, setYPosition
public final void setArcPts(int x1, int y1, int x2, int y2, int p3, int q3)
x1
- The x coordinate of the first click point of this arc.y1
- The y coordinate of the first click point of this arc.x2
- The x coordinate of the second click point of this arc.y2
- The y coordinate of the second click point of this arc.p3
- The x coordinate of the third click point of this arc.q3
- The y coordinate of the third click point of this arc.public boolean isCopy(JaxoObject comp)
isCopy
in class Jaxo3PointObject
comp
- The JaxoObject to compare against.public void setState(JaxoObject o)
JaxoObject.copy()
.setState
in class JaxoParticleObject
o
- the object to copy from.public void paintVisualAid(JaxoGraphics2D g2)
paintVisualAid
in class JaxoObject
g2
- The graphics context to paint the visual aid.protected final double[] getArcParameters()
public boolean isSingular()
An arc is considered singular if its arc length goes to infinity. This is the case when all three points are co-linear and the middle click-point is on the outside from the other two. In practice it is checked if the angle at the middle click-point is below a cutoff value of one degree.
Note that there is another type of singularity where the arc radius goes to infinity while the arc length stays finite. This is the case when the three points are co-linear and the middle click-point is between the other two. Such an arc is not considered singular, it only degenerates into a line.
Arc-specific methods generally return simplified values for singular arcs, eg the radius is set to infinity, so one should call this method first to make sure that returned values can be expected to be accurate.
protected boolean tooSingular(double epsilon)
epsilon
- upper bound for the angle at P2 (in radians).public JaxoArrow.Coordinates arrowCoordinates()
arrowCoordinates
in class JaxoParticleObject
public final boolean isClockwise()
public final double getArcLength()
public final double getOpeningAngle()
public final double getRadius()
getRadius
in class JaxoExtendedObject
public final java.awt.geom.Point2D.Double getEquidistantPoint(int i, int n)
i
- The index of the point to return.n
- The number of segments to divide the arc.public java.awt.geom.Point2D.Float[] getEquidistantPoints(int n)
n
- The number of segments to divide the arc.public final java.awt.geom.Point2D.Double getArcPoint(double t)
t
- The parameter, has to be between 0 and 1.public final java.awt.geom.Point2D.Double getCenterPoint()
public final java.awt.geom.Point2D.Double getMidArcPoint()
Licensed under GPL. For more information, see http://jaxodraw.sourceforge.net/license.html or the LICENSE file in the jaxodraw distribution.