input stringlengths 10 828 | output stringlengths 5 107 |
|---|---|
public double x2nd derivative value double t double dx 0 001 double f0 x value t double f1 x value t dx double f2 x value t 2 dx double g1 x value t dx double g2 x value t 2 dx return 16 f1 16 g1 30 f0 f2 g2 12 dx dx | computes x t for a given value of t |
public double y value double t double r radius get value double l stick get value return l r math sin t r r | define the y coordinate function y t r sin t for the curve |
public plane curve parametric get curve return curve | returns the curve to which this decoration applies |
public double y2nd derivative value double t double dx 0 001 double f0 y value t double f1 y value t dx double f2 y value t 2 dx double g1 y value t dx double g2 y value t 2 dx return 16 f1 16 g1 30 f0 f2 g2 12 dx dx | computes y t for a given value of t |
public void set curve plane curve parametric c curve c | sets the curve to which this decoration applies |
public void set t double t this t t fire decoration change event | change the value of t where the decoration appears |
public int get tresolution return t resolution get value | returns the number of intervals into which the curve is divided |
public double get t int index if t vals null index 0 index t vals length return double na n else return t vals index | return the t value for one of the points on the curve |
protected void make points int subintervals t resolution get value t vals new double subintervals 1 points new point2 d subintervals 1 double t tmin get value double dt tmax get value t subintervals for int i 0 i subintervals i t vals i t dt i for int i 0 i subintervals i double x x value t vals i double y y value t vals i if double is na n x double is na n y double is infinite x double is infinite y points i null else points i new point2 d double x y | calcululates the array of points for this curve using the functions |
public void do draw graphics2 d g view view transform transform if points length 0 return int point ct points length if view instanceof plane curve parametric view double fraction plane curve parametric view view fraction to draw if fraction 0 fraction 1 point ct int fraction point ct if point ct 0 point ct 1 view draw curve points point ct | draw the curve in a specified view |
protected void run animation normal bundle decoration dec dec new normal bundle decoration curve dec set layer 2 owner add decoration dec try int points curve get tresolution if show normals for int i 1 i points 1 i dec set point count i pause 20 pause 100 dec set point count 0 dec set show evolute true pause 200 for double offset 0 offset offset max offset offset increment dec set parallel curve offset offset pause 50 finally owner remove decoration dec | run the paralle curve animation |
public animation get create animation final view view if view null view instanceof plane curve parametric view return null return new timer animation 50 20 50 frames 20 mulliseconds per frame protected void draw frame plane curve parametric view view fraction to draw frame number 50 0 force redraw public void animation starting plane curve parametric view view fraction to draw 0 public void animation ending plane curve parametric view view fraction to draw 1 force redraw | returns an animation that shows the curve being drawn bit by bit |
public view get default view view view new plane curve parametric view view set show axes true return view | returns a new instance of the nested class |
public action list get actions for view final view view action list actions super get actions for view view if view null return actions actions add null puts a separator in the menu actions add new abstract action vmm i18n tr vmm planecurve parametric parabola show normals with mouse public void action performed action event evt view get display install one shot mouse task new show normals mouse task view return actions | returns a list of actions that are applicable to the exhibit |
public double x value double t aa aa get value bb bb get value double r aa bb math cos t return r math sin t | define the x coordinate function x t aa bb cos t cos t |
public double y value double t aa aa get value bb bb get value double r aa bb math cos t return r math cos t | define the y coordinate function y t aa bb cos t sin t |
private void abbreviations double t xa x value t ya y value t m xa ya rotx bb m roty rotx m tx roty ya ty rotx xa ex xa rotx ey ya bb nn math sqrt ex ex ey ey dt tmax get value tmin get value t resolution get value | t dependent abbreviations for draw needed stuff |
public double x value double t return cube cos t | define the x coordinate function x t cos t 3 for the curve |
public double y value double t return cube sin t | define the y coordinate function y t sin t 3 for the curve |
private double support function double t set constants return a b cos t c cos 2 t d cos 3 t e cos 4 t f cos 5 t | minkowski support function for the curve |
private double support derivative double t set constants return b sin t 2 c sin 2 t 3 d sin 3 t 4 e sin 4 t 5 f sin 5 t | derivative of minkowski support function |
public double x value double t return support function t cos t ph support derivative t sin t ph | define the x coordinate function for the curve |
public double y value double t return support function t sin t ph support derivative t cos t ph support function ph math pi 2 a | define the y coordinate function for the curve |
public void set point count int point ct if point ct 0 point ct 0 if this point ct point ct this point ct point ct fire decoration change event | sets the number of points on the curve at which normals appear |
public int get point count return point ct | gets the number of points on which normals appear |
public boolean get show evolute return show evolute | tells whether the evolute is curve is drawn |
public point2 d get point int index return points index | get one of the points in the point array that defines this curve |
public void set show evolute boolean show if show show evolute show evolute show fire decoration change event | if set to true then the evolute curve will be drawn |
public double get parallel curve offset return parallel curve offset | tells the distance between the curve and any parallel curves that are drawn |
public display xm get display return display | returns that display that is shown in this window |
public view get view return display get view | returns the view currently associated with this windows display or null if there |
public exhibit get exhibit return display get exhibit | returns the exhibit currently associated with this windows display or null if there |
public void set parallel curve offset double offset if offset parallel curve offset double is na n offset double is na n parallel curve offset parallel curve offset offset fire decoration change event | if the parallel curve offset is set to double |
public color get normals color return normal color | retruns the color used for drawing normal vectors |
public void set normals color color color if color null color color red if color equals normal color normal color color if point ct 0 fire decoration change event | set the color used for the normal lines the default is red |
public color get evolute color return evolute color | returns the color used for drawing the evolute |
public color get osculating circle color return osculating circle color | retruns the color used for drawing the osculating circle |
public void set osculating circle color color color if color null color color blue if color equals osculating circle color osculating circle color color if osculating circle index 0 fire decoration change event | set the color used for the osculating circle the default is blue |
public color get parallel curve color return parallel curve color | returns the color used for drawing the first parallel curve |
public color get parallel curve color2 return parallel curve color | returns the color used for drawing the second parallel curve |
public boolean get show two parallel curves return show two parallel curves | tells whether two parallel curves are drawn or just one |
public int get osculating circle index return osculating circle index | tells the index of the point where an osculatting circle is drawn |
public void set use unit normals boolean use unit normals if use unit normals this use unit normals this use unit normals use unit normals lines use unit normals unit normals evolute normals fire decoration change event | set whether unit normals are drawn |
public void show url url url history add url try edit pane set page url catch exception e edit pane set content type text plain edit pane set text i18n tr 3dxm htmldoc window load error n set visible true | set the contents of the window to a specified url |
public void show file string file history add file try url file url get class get class loader get resource file if file url null throw new exception edit pane set page file url catch exception e edit pane set content type text plain edit pane set text i18n tr 3dxm htmldoc window load error n set visible true | set the content of the window to the specified file |
protected void do defaults double default window view get exhibit get default window xmin input set text default window 0 xmax input set text default window 1 ymin input set text default window 2 ymax input set text default window 3 | this will be called when the user clicks the defaults button |
public function get real function return function function | returns the real valued function contained in this function info object or returns |
public double norm return math sqrt a a b b c c d d | returns the norm of this quaternion |
public quaternion plus quaternion q return new quaternion a q a b q b c q c d q d | compute the sum of this quaternaion and another quaternion |
public quaternion minus quaternion q return new quaternion a q a b q b c q c d q d | compute the difference of this quaternaion and another quaternion |
public quaternion times quaternion q return new quaternion a q a b q b c q c d q d a q b b q a c q d d q c a q c b q d c q a d q b a q d b q c c q b d q a | compute the product of this quaternaion and another quaternion |
public quaternion times double x return new quaternion a x b x c x d x | compute the product of this quaternaion and a real number |
public quaternion inverse double denom a a b b c c d d return new quaternion a denom b denom c denom d denom | compute the multiplicative inverser of this quaternion |
public quaternion divided by quaternion q return this times q inverse | compute the quotient of this quaternaion by another quaternion |
public quaternion rotate around hopf fibre double phi return new quaternion a b c math cos phi d math sin phi c math sin phi d math cos phi | returns rotation by phi around standard hopf fiber through 1 0 0 0 |
public quaternion rotate around hopf fibre double phi quaternion q0 quaternion p new quaternion this times q0 inverse p p rotate around hopf fibre phi return p times q0 | returns rotation by phi around standard hopf fiber through q0 |
public complex function get complex function return complex function function | returns the complex valued function contained in this function info object or returns |
public vector3 d stereographic projection return new vector3 d b 1 a c 1 a d 1 a | returns stereographic projection from 1 0 0 0 |
public void set value complex val set value object new complex val | set the value of this parameter to a specified value of type complex |
public complex get value complex d complex get value object if d null return new complex 0 0 else return d | returns the value of this object as a number of type complex |
public void set default value double val set default value object new complex val | sets the default value of the parameter to a specified complex value |
public complex get default value complex d complex get default value object if d null return new complex else return d | returns the default value of this parameter |
public boolean get is complex return is complex | tells whether the function is complex valued or real valued |
protected object string to value object string str throws number format exception complex expression exp try exp util parse complex constant expression str catch parse error e try return util external string to value str complex class catch exception e1 throw new number format exception i18n tr vmm core complex param bad expression str e get message complex d exp value if double is na n d re double is infinite d re double is na n d im double is infinite d im throw new number format exception i18n tr vmm core complex param undefined str return d | converts a string to an object of type complex |
protected string value object to string object obj return util to external string obj | returns a string representation of a value object of this parameters |
public void set value int val set value object new integer val | set the value of this parameter to a specified int |
public int get value integer obj integer get value object if obj null return 0 else return obj int value | get the value of this parameter in the form of an int |
public void set default value int val set default value object new integer val | sets the default value of the parameter to a specified int |
public int get default value object object get default value object if object null return 0 else return integer object int value | returns the default value of this parameter as an int |
public void add function parameter variable param p function parameters add p p set owner exhibit | in addition to the arguments of the function the definition of a function |
public void add function parameter complex variable param p function parameters add p p set owner exhibit | in addition to the arguments of the function the definition of a function |
public function info add real function string name string definition string argument name function info f new function info name definition argument name false functions add f return f | add a real valued function to the user info |
public function info add complex function string name string definition string argument name function info f new function info name definition argument name true functions add f return f | add a complex valued function to the user info |
public void set name string name super set name name variable set name name | sets the name of this parameter and of the associated variable |
public void set value object object object super set value object object if variable null it will be null when set value object is called during the constructor variable set val double object double value | sets the value of this parameter and of the associated variable |
public object get value object double val double super get value object if val double value variable get val val new double variable get val super set value object val return val | get the value object of this parameter |
public void set allow change user data command boolean allow change user data command this allow change user data command allow change user data command | sets the value of the allow change user data property |
public void set allow new parameters boolean allow new parameters this allow new parameters allow new parameters | sets the value of the allow new parameters property |
public string get name if name null return this get class get name else return name | returns a name for this view |
public void set show window boolean show window this show window show window | sets the value of the show window property |
public view defaults view view exhibit get default view dialog dialog create dialog null view true boolean ok dialog get data if ok return null finish dialog view true return view | this method initializes the user exhibit to the default values from its |
public view show create dialog display display view view exhibit get default view dialog dialog create dialog display view true boolean ok dialog show dialog if ok return null finish dialog view true return view | shows the dialog box where the user enters the data for the exhibit |
public boolean show change dialog display display view view dialog dialog create dialog display view false boolean ok dialog show dialog if ok return false finish dialog view false return true | shows the dialog box where the user enters the data for the exhibit |
public exhibit get exhibit return exhibit | get the exhibit that is shown in this view |
public void set exhibit exhibit exhibit if exhibit this exhibit return if this exhibit null this exhibit remove change listener this this exhibit remove view this this exhibit exhibit if exhibit null set transform null set background null set foreground null else exhibit add change listener this exhibit add view this set transform exhibit get default transform this set background exhibit get default background set foreground exhibit get default foreground force redraw | set the exhibit that is shown in this view |
public void set layer int layer if this layer layer this layer layer fire decoration change event | set the layer in which this decoration is drawn |
public void force redraw decoration needs redraw true fire decoration change event | causes this decoration to be recomputed and redrawn |
synchronized public void add change listener change listener listener if listener null return if change listeners null change listeners new array list change listener change listeners add listener | change events are sent when the decoration needs to be redrawn |
synchronized public void remove change listener change listener listener if listener null change listeners null change listeners remove listener if change listeners is empty change listeners null | change events are sent when the decoration needs to be redrawn |
public void set color color c if c null color color gray else color c | set the color that is used for drawing the axes |
public void do draw graphics2 d g view view transform transform color save color g get color g set color color if between 0 transform get ymin transform get ymax view draw line transform get xmin 0 transform get xmax 0 if between 0 transform get xmin transform get ymax view draw line 0 transform get ymax 0 transform get ymin g set color save color | draws the axes in a specified view |
public void set frame int frame number buffered image image if frame number images size images set frame number image else while images size frame number 1 images add null images add image | sets a specified frame in the filmstrip to a given image |
public int get frame count return images size | returns the current number of frames in the filmstrip |
public buffered image get frame int frame number return images get frame number | returns the image at at a specified position in the filmstrip |
public void strip null frames for int i images size 1 i 0 i if images get i null images remove i | removes any frames for which the image is null from the filmstrip |
protected string do get string key if key null key length 0 return null if map null map new hash map string string key default prefix key if map contains key key return map get key string value try if preferences root null preferences root preferences user root value preferences root get key null catch exception e value null map put key value return value | get the preference value associated with a key |
protected void do put string key string value if key null key length 0 throw new illegal argument exception key string must be non null and non empty if map null map new hash map string string map put default prefix key value | associates a given preference value with a given key |
protected boolean do save if map null map size 0 return true try if preferences root null preferences root preferences user root for map entry string string item map entry set string key item get key string value item get value string old value preferences root get key null if value null old value null preferences root remove key else if value null value equals old value preferences root put key value return true catch exception e return false | tries to save any modified preference values to persistent storage using |
protected boolean do save string key if map null map size 0 return true key default prefix key if map contains key key return true string value map get key try if preferences root null preferences root preferences user root string old value preferences root get key null if value null old value null preferences root remove key else if value null value equals old value preferences root put key value return true catch exception e return false | tries to save any modified preference values to persistent storage using |
public boolean equals object obj try complex c complex obj return c re re c im im catch exception e return false | returns true if obj is equal to this complex number |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.