vmm3d.planecurve.parametric
Class PlaneCurveParametric
- java.lang.Object
-
- vmm3d.core.Exhibit
-
- vmm3d.planecurve.PlaneCurve
-
- vmm3d.planecurve.parametric.PlaneCurveParametric
-
- All Implemented Interfaces:
- java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable
- Direct Known Subclasses:
- ArchimedeanSpiral, Catenary, ConicSection, DecoratedCurve, Folium, Limacon, Lissajous, Logarithmicspiral, Nephroid, NephroidOfFreeth, UserPlaneCurveParametric, UserPlaneCurveParametricKappa, UserPlaneCurveParametricPolar
public abstract class PlaneCurveParametric extends PlaneCurve
A curve in the plane that is defined by differentiable functions x(t) and y(t).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classPlaneCurveParametric.PlaneCurveParametricViewDefines the default View of a PlaneCurveParametric.
-
Constructor Summary
Constructors Constructor and Description PlaneCurveParametric()Construct a plane curve with Parameters tmin, tmax, and tResolution.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voiddoDraw(org.freehep.graphics2d.VectorGraphics g, View view, Transform transform)Draw the curve in a specified View.ActionListgetActionsForView(View view)Returns a list of actions that can be applied to a PlaneCurveParametric.AnimationgetCreateAnimation(View view)Returns an animation that shows the curve being drawn bit-by-bit.ViewgetDefaultView()Returns a new instance of the nested classPlaneCurveParametric.PlaneCurveParametricView.doublegetT(int index)Return the t-value for one of the points on the curve.intgetTResolution()Returns the number of intervals into which the curve is divided.java.awt.geom.Point2D[]myCircle(double mx, double my, double rad, int numPoints)parametrized circle to draw circle arcs in different colors.doublex2ndDerivativeValue(double t)Computes x''(t) for a given value of t.doublexDerivativeValue(double t)Computes x'(t) for a given value of t.abstract doublexValue(double t)Computes x(t) for a given value of t.doubley2ndDerivativeValue(double t)Computes y''(t) for a given value of t.doubleyDerivativeValue(double t)Computes y'(t) for a given value of t.abstract doubleyValue(double t)Computes y(t) for a given value of t.-
Methods inherited from class vmm3d.planecurve.PlaneCurve
fillRandomSquare, getPoint, getPointCount, initializeMovingSquare
-
Methods inherited from class vmm3d.core.Exhibit
addChangeListener, addDecoration, addExtraXML, addView, clearDecorations, forceRedraw, getAdditionalAnimationsForView, getAlternativeViews, getBuildAnimation, getDecorations, getDefaultBackground, getDefaultForeground, getDefaultTransform, getDefaultWindow, getFramesForMorphing, getMorphingAnimation, getName, getParameterByName, getParameters, getSettingsCommandsForView, getTitle, getUseFilmstripForMorphing, getViews, parameterChanged, readExtraXML, removeChangeListener, removeDecoration, removeView, render, setDefaultBackground, setDefaultForeground, setDefaultWindow, setDefaultWindow, setFramesForMorphing, setName, setUseFilmstripForMorphing, stateChanged
-
-
-
-
Constructor Detail
-
PlaneCurveParametric
public PlaneCurveParametric()
Construct a plane curve with Parameters tmin, tmax, and tResolution. The curve will be defined by the functionsxValueandyValuein a concrete subclass.
-
-
Method Detail
-
xValue
public abstract double xValue(double t)
Computes x(t) for a given value of t.
-
yValue
public abstract double yValue(double t)
Computes y(t) for a given value of t.
-
xDerivativeValue
public double xDerivativeValue(double t)
Computes x'(t) for a given value of t. The default version defined in this class computes an approximate value numerically, using values of the function itself at points near t.
-
yDerivativeValue
public double yDerivativeValue(double t)
Computes y'(t) for a given value of t. The default version defined in this class computes an approximate value numerically, using values of the function itself at points near t.
-
x2ndDerivativeValue
public double x2ndDerivativeValue(double t)
Computes x''(t) for a given value of t. The default version defined in this class computes an approximate value numerically, using values of the function itself at points near t.
-
y2ndDerivativeValue
public double y2ndDerivativeValue(double t)
Computes y''(t) for a given value of t. The default version defined in this class computes an approximate value numerically, using values of the function itself at points near t.
-
getTResolution
public int getTResolution()
Returns the number of intervals into which the curve is divided. Note that the number of points that are drawn on the curve is one more than the tResolution.
-
getT
public double getT(int index)
Return the t-value for one of the points on the curve. The number of points is getTResolution() + 1, and they are numbered from 0 to getTResolution(). If this method is called before the curve has been drawn, the return value will be Double.NaN. The return value is also Double.NaN if the specified index is not in the range 0 to getTResolution(), inclusive. The corresponding point on the curve can be obtained by calling xValue() and yValue()The value returned by this method is only valid after the curve has been drawn; if it is called before that time, the return value will be Double.NaN.
- Parameters:
index- A position in the array of t-values that specifies which t-value shoud be returned.- See Also:
getTResolution(),xValue(double),yValue(double)
-
myCircle
public java.awt.geom.Point2D[] myCircle(double mx, double my, double rad, int numPoints)parametrized circle to draw circle arcs in different colors.
-
doDraw
public void doDraw(org.freehep.graphics2d.VectorGraphics g, View view, Transform transform)Draw the curve in a specified View. If the View belogs to the nested classPlaneCurveParametric.PlaneCurveParametricView(which is the default), then only a fraction of the curve might be drawn, as specified in the View; this feature is used in the creation animation for the curve.- Parameters:
g- The graphics context where the Exhibit is being drawn. It has already been cleared to the background color (assuming that drawing is being done in the usual way, as defined in the top-level View class).view- The View that is drawing the Exhibit; this object contains other information that might be of use, such as the Display, if any, associated with the View.transform- Contains information about the rectangular area in the xy-plane that is being drawn and about the rectangle of pixels in the graphics context where it is drawn. Note that at least for the top-level View class, transform.getX() and transform.getY() can be assumed to be zero.- See Also:
#render(Graphics2D, View, Transform, ArrayList),Exhibit.computeDrawData(View, boolean, Transform, Transform)
-
getCreateAnimation
public Animation getCreateAnimation(View view)
Returns an animation that shows the curve being drawn bit-by-bit.- Overrides:
getCreateAnimationin classExhibit- Parameters:
view- The View where the creation animation will be shown. If this is null or if it is not an instance ofPlaneCurveParametric.PlaneCurveParametricView, then the return value is null.- Returns:
- A creation animation for the given View of this Exhibit. The return value can be null to indicate that no creation animation is to be run.
-
getDefaultView
public View getDefaultView()
Returns a new instance of the nested classPlaneCurveParametric.PlaneCurveParametricView.- Overrides:
getDefaultViewin classExhibit
-
getActionsForView
public ActionList getActionsForView(View view)
Returns a list of actions that can be applied to a PlaneCurveParametric. This adds a separator and four actions that run various animations to the list obtained from super.getActionsForView(view).- Overrides:
getActionsForViewin classExhibit- Parameters:
view- The view for which the actions should apply. If this is null, then no new actions are added to those inherited from the superclass.
-
-
DMelt 3.0 © DataMelt by jWork.ORG