input
stringlengths
10
828
output
stringlengths
5
107
public complex matrix2 d multiply complex matrix2 d inp complex matrix2 d the product new complex matrix2 d for int i 1 i 3 i for int j 1 j 3 j the product entries i j new complex for int k 1 k 3 k the product entries i j the product entries i j plus entries i k times inp entries k j return the product
multiply to the right by matrix inp
public complex matrix2 d transpose complex matrix2 d the transpose new complex matrix2 d the transpose entries 1 1 entries 1 1 the transpose entries 1 2 entries 2 1 the transpose entries 2 1 entries 1 2 the transpose entries 2 2 entries 2 2 return the transpose
compute and return the transpose of the matrix
public complex matrix2 d conjugate complex matrix2 d the conjugate new complex matrix2 d the conjugate entries 1 1 entries 1 1 conj the conjugate entries 1 2 entries 1 2 conj the conjugate entries 2 1 entries 2 1 conj the conjugate entries 2 2 entries 2 2 conj return the conjugate
compute and return the conjugate of the matrix
public complex matrix2 d add complex matrix2 d inp complex matrix2 d thesum new complex matrix2 d thesum entries 1 1 entries 1 1 plus inp entries 1 1 thesum entries 1 2 entries 1 2 plus inp entries 1 2 thesum entries 2 1 entries 2 1 plus inp entries 2 1 thesum entries 2 2 entries 2 2 plus inp entries 2 2 return thesum
compute and return the result of adding the matrix with inp
public complex matrix2 d subtract complex matrix2 d inp complex matrix2 d thedifference new complex matrix2 d thedifference entries 1 1 entries 1 1 minus inp entries 1 1 thedifference entries 1 2 entries 1 2 minus inp entries 1 2 thedifference entries 2 1 entries 2 1 minus inp entries 2 1 thedifference entries 2 2 entries 2 2 minus inp entries 2 2 return thedifference
compute and return the result of subtracting inp from the matrix
public parameter input create parameter input int input type return new parameter input this input type
returns an input box for getting the value animation start value or animation
public string to string string out new string out out entries 1 1 to string out out entries 1 2 to string out out entries 2 1 to string out out entries 2 2 to string out return out
print the content of the matrix in the format a11 a12 a21 a22
public boolean get use filmstrip for morphing return use filmstrip for morphing
returns the value of the use filmstrip for morping property
public string to string return get title get value as string
returns a string including both the title and value of this parameter
public void set use filmstrip for morphing boolean use filmstrip for morphing this use filmstrip for morphing use filmstrip for morphing
sets the value of the use filmstrip for morphing property
public complex vector2 d plus complex vector2 d v return new complex vector2 d x plus v x y plus v y
returns the vector sum of this vector and v
public complex vector2 d minus complex vector2 d v return new complex vector2 d x minus v x y minus v y
returns the vector difference of this vector and v
public complex dot complex vector2 d v complex c1 new complex x times v x conj complex c2 new complex y times v y conj return c1 plus c2
returns the hermitian inner prodct of this vector and v
public double norm2 return this dot this re
returns the norm square of the vector
public void set grid spacing int grid spacing if grid spacing 0 grid spacing 0 if this grid spacing grid spacing return this grid spacing grid spacing for int i 0 i standard grid spacings length i if grid spacing standard grid spacings i grid spacing select set selected index i break force redraw
determines how many grid lines are actually drawn
public int get grid spacing return grid spacing
set the spacing between grid lines that are drawn
public boolean get show ugrid lines return show ugrid lines
tells whether grid lines are drawn in the u direction
public void set show ugrid lines boolean show ugrid lines if this show ugrid lines show ugrid lines this show ugrid lines show ugrid lines omit uline action put value toggle status new boolean show ugrid lines force redraw
set whether grid lines are drawn in the u direction
public boolean get show vgrid lines return show vgrid lines
tells whether grid lines are drawn in the v direction
public void set show vgrid lines boolean show vgrid lines if this show vgrid lines show vgrid lines this show vgrid lines show vgrid lines omit vline action put value toggle status new boolean show vgrid lines force redraw
set whether grid lines are drawn in the v direction
public void set exhibit exhibit exhibit super set exhibit exhibit if exhibit null exhibit instanceof surface set orientation surface exhibit get default orientation
this method is overridden to set the orientation of a surface exhibit from
public int get default orientation return default orientation
returns the default orientation setting for this surface
protected void add parameter parameter param if param null return if parameters null parameters new array list parameter if parameters contains param return parameters add param param set owner this
associate a parameter with this view
public void set default orientation int default orientation if default orientation this default orientation default orientation view3 dlit normal orientation default orientation view3 dlit no orientation default orientation view3 dlit reverse orientation this default orientation default orientation
set the default orientation setting for this surface
public view get default view surface view view new surface view return view
returns a default view of this exhibit a view of type
synchronized public void stop animation if animation null if animation is running animation cancel if animation instanceof timer animation timer animation animation set display null filmstrip f timer animation animation get filmstrip if f null f strip null frames int loop timer animation animation get looping if loop timer animation loop f set frame f get frame count 1 null needed since last frame of oscillating animatin is not used if f get frame count 1 set saved filmstrip f loop animation null set status status idle repaint choose cursor
stop any animation that is currently installed
protected complex gauss complex z return z power ee plus z power ff times b complex aux1 new complex complex aux2 new complex complex aux3 new complex aux1 assign pow z ee aux2 assign pow z ff aux2 assign times b aux3 assign plus aux1 aux2 return aux3
the next two functions are the weierstrass data that
protected void remove parameter parameter param if param null parameters null parameters contains param return parameters remove param param set owner null
removes a parameter from this view
protected complex gauss complex z return z ex 1 z ex aa ex 1 aa ex z ex complex w if e odd 0 return z integer power e odd return one c to see the domain else complex wk z integer power ex 1 w z times wk complex aux w times rex aux re aux re 1 w re w re rex w wk times w divided by aux return w
the following two functions are the weierstrass data that
synchronized protected void fire exhibit change event if change listeners null return if change event null change event new change event this if is morphing morphing view null for int i 0 i change listeners size i if change listeners get i instanceof view view v view change listeners get i if v get display morphing view get display v state changed change event else for int i 0 i change listeners size i change listeners get i state changed change event
sends a change event to registered change listeners
synchronized public void set time dilation for animations double dilation factor if dilation factor 0 2 dilation factor 0 2 else if dilation factor 100 dilation factor 100 time dilation for animations dilation factor if animation null animation set time dilation dilation factor
sets the speed for any animation that runs in this display
public double get time dilation for animations return time dilation for animations
returns the speed factor for animations that run in this display
protected complex gauss complex z complex z2 z times z complex z2 new complex 1 z2 re z2 im z2 re 1 z2 re complex w z2 inverse times z2 double x 2 w im r1 w im 2 w re w re x complex aux w times 2 r2 r1 aux re aux re 1 aux im aux im complex aux2 aux times aux aux2 re aux2 re 1 the next two lines are crucial they achieve an analytic continuation complex g2 aux2 square root nearer aux minus aux return g2 square root nearer i1 c
the following two functions are the weierstrass data that
public void add decoration decoration d if d null return if decorations null decorations new array list decoration if decorations contains d return decorations add d d add change listener this force redraw
add a decoration that will appear in this view only
protected complex vector3 d get center complex vector3 d g c new complex vector3 d helper array 0 0 g c g c plus helper array 0 vcount 1 times 0 5 return g c
we want to center the surface one hexagon already at the helper level
public void parameter changed parameter param object old value object new value super parameter changed param old value new value if param aa param hh param u patch count param mp this is not enough needs new array true
overrides to set needs new array
protected void create data if needs new array redo constants and array super create data
before create data executes constants and array are redone
private double find umax double a2 aa aa double aux a2 1 2 a2 double w math sqrt math abs math sqrt hh hh a2 a2 aux aux aux double result if in2nd morph result math min 0 5 math acos w else result math acos w return result
we compute the surface transversal to the helices until it becomes singular
protected complex gauss complex z return z exponential
the following two functions are the weierstrass data that
protected complex gauss complex z return new complex z
the following two functions are the weierstrass data that
private void create curve array double t0 umin get value double t transvers curve 0 midpoint odestep 0 t0 start point 32 double dt umax get value t0 tr 1 for int i 1 i tr i t t0 i 1 du transvers curve i midpoint odestep t t du transvers curve i 1 8 needs new array false
the transversal curve is precomputed and stored in the array transvers curve
public void remove decoration decoration d if decorations null d null decorations contains d decorations remove d if decorations size 0 decorations null d remove change listener this force redraw
remove a specified decoration from this view if present
protected complex gauss complex z return lrp z 2 1 return new complex one c for viewing the domain complex w z times z w re lrp w re 1 w im lrp w im return w
the following two functions are the weierstrass data that
protected complex gauss complex z return z weierstrass p return new complex z
the following two functions are the weierstrass data that
public vector3 d surface point double u double v
override to close the hole around the images of p 1 p
private double height double v long num 2 math round 2 8 math abs v double w 0 double y integrand 0 if v 0 double dv v num for int i 1 i num i i 2 y integrand i dv w w 4 y y integrand i 1 dv w w 2 y w w y dv 3 return w
simpson integration 1 4 2 4 2
public void clear decorations if decorations null for int i 0 i decorations size i decorations get i remove change listener this decorations null force redraw
remove all decorations from this view
public action list get actions for view final view view action list actions new action list abstract action vmm create action new abstract action vmm i18n tr vmm core commands create k public void action performed action event evt animation create get create animation view if create null if view null view get display null view get display install animation create else create start else force redraw will force build animation to run even if there is no create animation actions add create action return actions
this method returns a list of
protected complex domain grid double u double v return new complex u v
most minimal surfaces need a specially adapted domain grid
protected void p index complex z for int i 0 i ucount i z domain grid umin get value i du vmin get value if math abs z im 0 0001 i p i
last index of grid point before symmetry line switches to straight line
protected complex vector3 d get center int um int math floor ucount 1 2 0 int vm int math floor vcount 1 2 0 return new complex vector3 d helper array um vm
the next function is used to center the helper array mostly overridden
protected complex gauss complex z return lrp z u u ex 1 z z complex aux double denom z re z re z im z im complex w new complex z re denom z re z im 1 0 denom 1 w 1 z z if z im 0 aux w log nearer zero c times 1 0 double ex else aux w log nearer ip c times 1 0 double ex w aux exponential w 1 u w assign times z w assign times lrp return w
the following two functions are the weierstrass data that
protected void p index complex z for int i 0 i ucount i z domain grid umin get value i du vmin get value if z re 0 0001 math abs z im 0 0001 i p i i p i p int math floor ex 3 0 ex 2 0 2 0
last index of grid point before symmetry line switches to straight line
protected complex gauss complex z return lrp u ex 1 u ex 1 z z complex aux double denom z re z re z im z im complex w new complex z re denom z re z im 1 0 denom 1 w 1 z z if z im 0 aux w log nearer zero c times 1 0 1 0 double ex else aux w log nearer ip c times 1 0 1 0 double ex w aux exponential w assign times lrp return w
the following two functions are the weierstrass data that
public action list get view commands action list commands new action list commands add show axes action commands add null commands add background commands return commands
returns a list of view commands that can be applied to this view
protected void redo constants global variables independent of the points hence thread safe super redo constants if needs period closed lrp 1 0 else lrp lrpclosed lrp get value lopez ros parameter ex exponent get value r1 1 0 amp 1 0 2048 0 double ex double ex double ex p index needs dv system out println i p um int math floor ucount 1 2 0 ucount vcount are odd vm int math floor vcount 1 2 0
redo constants is called in super
protected void redo constants ucount 1 u patch count get value 6 vcount 1 v patch count get value 6 helper array new complex vector3 d ucount vcount du umax get value umin get value ucount 1 dv vmax get value vmin get value vcount 1
redo constants is called in create data above before any other computations start
public action list get settings commands return new action list
generates a list of settings commands that can be applied to this view
protected complex gauss complex z return z jd return new complex z
the following two functions are the weierstrass data that
protected complex vector3 d get center if in associate morph keeps the saddle fixed return new complex vector3 d helper array um vm else if wants to see domain return new complex vector3 d helper array 0 0 plus helper array ucount 1 0 times 0 5 return new complex vector3 d zero c zero c zero c else complex vector3 d g c new complex vector3 d helper array ucount 1 j p g c g c plus complex vector integrator domain grid umax get value vmin get value j p dv q p 32 return g c
we want to center the surface already at the helper level
public vector3 d surface normal double u double v complex z domain grid u v complex g gauss z vector3 d vv new vector3 d g re 2 0 g im 2 0 g abs2 1 0 system out println in override gauss presently gauss map is not used double norm vv norm if double is infinite norm double is na n norm norm 0 vv x 1 0 vv y 0 0 vv z 0 0 else vv normalize return vv
the surface normal is called often while rendering the surface
protected complex vector3 d complex vector function complex z complex g h if wants to see domain g new complex one c h new complex one c else g gauss z h h prime z return new complex vector3 d h times g h divided by g h times 2 0
the auxiliary weierstrass integrand complex vector3 d dh g dh g 2dh
public boolean get stop animations on resize return stop animations on resize
get the property that determines whether animations in this view are stopped
protected complex gauss complex z return jd sqrt p r 1 weierstrass p weierstrass p p p 1 r double denom z re z re z im z im complex w new complex pr z re denom z re r pr z im 1 denom 1 if z im 0 w w square root nearer i2 c else w w square root nearer i1 c return w
the following two functions are the weierstrass data that
protected complex vector3 d get center return new complex vector3 d helper array um vm default if in associate morph keeps the saddle fixed return new complex vector3 d helper array um vm else complex vector3 d g c new complex vector3 d helper array 0 j p g c g c plus complex vector integrator domain grid umin get value vmin get value j p dv q p 16 return g c
we want to center the surface already at the helper level
public action list get actions return new action list
generates a list of action commands that can be applied to this view
public void set stop animations on resize boolean stop animations on resize this stop animations on resize stop animations on resize
set the stop animation on resize property which determines whether animations in this
public action list get additional animations for view view view return new action list
this method returns a list of
public surface parametric add parameter vmax add parameter vmin add parameter umax add parameter umin set frames for morphing 20
adds umin umax vmin and vmax as parameters of the exhibit
public complex vector3 d helper to minimal complex vector3 d hp return new complex vector3 d hp y minus hp x hp y plus hp x times i c hp z
the integrated values that are collected in complex vector3 d helper array are
synchronized public void install mouse task mouse task task if one shot mouse task null one shot mouse task is for main view one shot mouse task finish this main view set status status idle one shot mouse task null drag task null if mouse task null mouse task finish this main view mouse task task if mouse task null mouse task start this main view choose cursor set status text null
install a default mouse handler for this display
public void add view view view if view null return if views null views new array list view if views contains view views add view
adds a view to the list of views that are displaying this exhibit
public complex vector3 d minimal to helper complex vector3 d mn return new complex vector3 d mn x plus mn y times i c times 0 5 mn x minus mn y times i c times 0 5 mn z
inverse function to the previous helper to minimal
public void remove view view view if views null views remove view
removes a view from the list of views that are displaying this exhibit
protected complex gauss complex z return z
the following two functions are the weierstrass data that
public mouse task get mouse task return mouse task
returns the current mouse task
public vector3 d surface normal double u double v vector3 d d1 deriv u u v vector3 d d2 deriv v u v return d1 cross d2
returns the surface normal by default from numerical differentiation
protected complex vector3 d get center complex vector3 d g c new complex vector3 d helper array 0 0 g c g c plus helper array 0 vcount 1 times 0 5 return g c new complex vector3 d zero c zero c zero c
we want to center the surface one hexagon already at the helper level
public action list get additional animations return new action list
this method returns a list of
public void remove view view view super remove view view if task manager null get views null get views size 0 task manager shut down task manager null
overridden to shut down the task manager that is used for parallelization
protected complex gauss complex z return new complex z integer power ex 1
the following two functions are the weierstrass data that
public void add decoration decoration d if d null return if decorations null decorations new array list decoration if decorations contains d return decorations add d d add change listener this fire exhibit change event
add a decoration that will appear in all views of this exhibit
synchronized public void install auxiliary mouse task mouse task task if auxiliary view null return if one shot mouse task null one shot mouse task is for main view one shot mouse task finish this auxiliary view set status status idle one shot mouse task null drag task null if auxiliary mouse task null auxiliary mouse task finish this auxiliary view auxiliary mouse task task if auxiliary mouse task null auxiliary mouse task start this auxiliary view choose cursor set status text null
install a default mouse handler for the auxiliary view in display
public void remove decoration decoration d if decorations null d null decorations contains d decorations remove d d remove change listener this if decorations size 0 decorations null fire exhibit change event
remove a specified decoration if present
public action list get additional animations for view and exhibit action list exhibit commands null if exhibit null exhibit commands exhibit get additional animations for view this action list view commands get additional animations if exhibit commands null view commands null return null action list combined commands new action list if exhibit commands null combined commands add all exhibit commands if view commands null view commands get item count 0 if combined commands get item count 0 combined commands add null combined commands add all view commands return combined commands
returns the combined contents of the lists obtained from
public void clear decorations if decorations null for int i 0 i decorations size i decorations get i remove change listener this decorations null fire exhibit change event
remove all decorations from the exhbiit
public view get default view return new view
this method returns a default view object for viewing this exhibit
synchronized public void install auxiliary one shot mouse task mouse task task if auxiliary view null return if one shot mouse task null one shot mouse task finish this one shot mouse task is for main view main view auxiliary view drag task null one shot mouse task is for main view false one shot mouse task task if one shot mouse task null stop animation one shot mouse task start this auxiliary view set status status one shot mouse task else set status status idle choose cursor
install a mouse task in the auxiliary view
public void set default window double xmin double xmax double ymin double ymax default window new double xmin xmax ymin ymax
set the default window in the xy plane for viewing this exhibit
public void force redraw needs redraw true if build animation null build animation cancel if display null display repaint
force the exhibit to be completely redrawn
public void set default window double window set default window window 0 window 1 window 2 window 3
sets the default window in the xy plane for viewing this exhibit using
protected complex gauss complex z return az ex q1 r1 z complex w new complex a z re a z im w assign pow w ex w assign plus q1 w assign times r1 w assign divide z return w
the following two functions are the weierstrass data that
protected complex gauss complex z return z ex 1 z ex aa ex 1 aa ex z ex complex w complex wk z integer power ex 1 w z times wk complex aux w times rex aux re aux re 1 w re w re rex w wk times w divided by aux return w
the following two functions are the weierstrass data that
public transform get default transform view view double window get default window return new transform window 0 window 1 window 2 window 3
returns a default transform object to be used in the specified view
protected complex vector3 d get center complex vector3 d g c new complex vector3 d helper array ucount 1 j0 g c g c plus complex vector one step integrator domain grid umax get value vmin get value j0 dv del if in associate morph keeps the saddle fixed else g c z new complex helper array ucount 1 0 z the third component of helper is also the surface coordinate return g c
we want to center the surface already at the helper level
protected complex gauss complex z return w 1 jd jd 1 complex w new complex 1 z re z im w assign divide new complex z re 1 z im return w
the following two functions are the weierstrass data that
static public void transvect vector3 d e1 vector3 d e2 vector3 d source vector3 d destination vector3 d midpoint new vector3 d e1 plus e2 normalized reflect in axis midpoint reflection in axis e1 source destination system out println dot prod destination destination system out println dot prod e2 e2 system out println e2 x system out println e2 y system out println e2 z system out println
e1 and e2 should be linearly independent unit vectors
static public vector3 d transvection vector3 d e1 vector3 d e2 vector3 d source vector3 d midpoint new vector3 d e1 plus e2 normalized system out println reflection in axis midpoint reflection in axis e1 source norm return reflection in axis midpoint reflection in axis e1 source
e1 and e2 should be linearly independent unit vectors
public void set default background color c if c null default background color white else default background c if default background get red 150 default background get green 120 default background get blue 150 set default foreground color white else set default foreground color black
set the default background color for this exhibit
public void set default foreground color c if c null default foreground color black else default foreground c
set the default foreground color for this exhibit