vmm.planecurve.parametric
Class Parabola

java.lang.Object
  extended by vmm.core.Exhibit
      extended by vmm.planecurve.PlaneCurve
          extended by vmm.planecurve.parametric.PlaneCurveParametric
              extended by vmm.planecurve.parametric.ConicSection
                  extended by vmm.planecurve.parametric.Parabola
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable

public class Parabola
extends ConicSection

A parabola with a focus on the x-axis. The parabola is defined by its focal length.


Nested Class Summary
 
Nested classes/interfaces inherited from class vmm.planecurve.parametric.PlaneCurveParametric
PlaneCurveParametric.PlaneCurveParametricView
 
Field Summary
 
Fields inherited from class vmm.planecurve.parametric.PlaneCurveParametric
tmax, tmin, tResolution, tVals
 
Fields inherited from class vmm.planecurve.PlaneCurve
movingSquare, points, randomSquare
 
Fields inherited from class vmm.core.Exhibit
decorations, exhibitNeedsRedraw, isMorphing, morphingView, parameters, previousTransform
 
Constructor Summary
Parabola()
          Construct a parabola with a focus initially at the point (0.75.0).
 
Method Summary
protected  void drawFociAndDirectrix(java.awt.Graphics2D g, View view, Transform limits, double t)
          This is overridden in the sub-classes to do the actual drawing of the extra decorations.
 ActionList getActionsForView(View view)
          Returns a list of actions that are applicable to the exhibit.
 double x2ndDerivativeValue(double t)
          Computes x''(t) for a given value of t.
 double xDerivativeValue(double t)
          Computes x'(t) for a given value of t.
 double xValue(double t)
          Computes x(t) for a given value of t.
 double y2ndDerivativeValue(double t)
          Computes y''(t) for a given value of t.
 double yDerivativeValue(double t)
          Computes y'(t) for a given value of t.
 double yValue(double t)
          Computes y(t) for a given value of t.
 
Methods inherited from class vmm.planecurve.parametric.ConicSection
getCreateAnimation, getMorphingAnimation
 
Methods inherited from class vmm.planecurve.parametric.PlaneCurveParametric
doDraw, getDefaultView, getT, getTResolution, makePoints, myCircle
 
Methods inherited from class vmm.planecurve.PlaneCurve
computeDrawData, fillRandomSquare, getPoint, getPointCount, initializeMovingSquare, moveSquare
 
Methods inherited from class vmm.core.Exhibit
addChangeListener, addDecoration, addExtraXML, addParameter, addView, clearDecorations, computeDrawDataHook, doDrawHook, fireExhibitChangeEvent, forceRedraw, getAdditionalAnimationsForView, getAlternativeViews, getBuildAnimation, getDecorations, getDefaultBackground, getDefaultForeground, getDefaultTransform, getDefaultWindow, getFramesForMorphing, getName, getParameterByName, getParameters, getSettingsCommandsForView, getTitle, getUseFilmstripForMorphing, getViews, parameterChanged, readExtraXML, removeChangeListener, removeDecoration, removeParameter, removeView, render, setDefaultBackground, setDefaultForeground, setDefaultWindow, setDefaultWindow, setFramesForMorphing, setName, setUseFilmstripForMorphing, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parabola

public Parabola()
Construct a parabola with a focus initially at the point (0.75.0). The focal length is an animateable parameter with animation start and end values initially set to 0.5 and 1.5. The parabola is acutally computed using the parametric equations (t,t*t/(4*f)), where f is the focal length and t ranges from -8 to 8.

Method Detail

xValue

public double xValue(double t)
Description copied from class: PlaneCurveParametric
Computes x(t) for a given value of t.

Specified by:
xValue in class PlaneCurveParametric

yValue

public double yValue(double t)
Description copied from class: PlaneCurveParametric
Computes y(t) for a given value of t.

Specified by:
yValue in class PlaneCurveParametric

xDerivativeValue

public double xDerivativeValue(double t)
Description copied from class: PlaneCurveParametric
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.

Overrides:
xDerivativeValue in class PlaneCurveParametric

yDerivativeValue

public double yDerivativeValue(double t)
Description copied from class: PlaneCurveParametric
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.

Overrides:
yDerivativeValue in class PlaneCurveParametric

x2ndDerivativeValue

public double x2ndDerivativeValue(double t)
Description copied from class: PlaneCurveParametric
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.

Overrides:
x2ndDerivativeValue in class PlaneCurveParametric

y2ndDerivativeValue

public double y2ndDerivativeValue(double t)
Description copied from class: PlaneCurveParametric
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.

Overrides:
y2ndDerivativeValue in class PlaneCurveParametric

drawFociAndDirectrix

protected void drawFociAndDirectrix(java.awt.Graphics2D g,
                                    View view,
                                    Transform limits,
                                    double t)
Description copied from class: ConicSection
This is overridden in the sub-classes to do the actual drawing of the extra decorations.

Specified by:
drawFociAndDirectrix in class ConicSection

getActionsForView

public ActionList getActionsForView(View view)
Returns a list of actions that are applicable to the exhibit. To the actions set up by the superclass, this adds a "Drag Mouse to Show Normals" action that lets the user drag the mouse and draws all normal vectors of the parabola that pass through the mouse location.

Overrides:
getActionsForView in class PlaneCurveParametric
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.