<span style="font-size: 12pt;" data-mce-style="font-size: 12pt;"><span style="font-family: arial, he... contains the JSL for this post, complete with axis specifications not shown here.

JSL graphics has a new XYFunction to complete the YFunction and XFunction trilogy. The YFunction came first; it creates a curve where Y, the vertical axis, is a function of X, the horizontal axis. So it makes familiar graphs:

The XFunction turns all that on its side, and makes school teachers cringe after spending all that time explaining how the dependent variable *always* goes on the vertical axis. Generally you don’t want to fight the convention, but you can…

Which brings me to the XYFunction.

In 1960 we took a vacation in the mountains of North Carolina, with a side trip to Tweetsie Railroad (theme park train page). Aside from the cowboys, Indians, train robbery, etc, one part of the event really stood out. Dad walked me from one side of the steam engine to the other and explained how the pistons worked to drive the wheels, how they could drive the wheels forward or reverse, and most importantly, how the wheels were 90 degrees out of phase so there could never be a time when both pistons were at top- or bottom-dead-center. It’s amazing, the stuff I remember from when I was 5. Dad was really upset when he discovered the Tweetsie bumper sticker someone put on his ’50 Ford.

The 90 degree out of phase points on the wheels are just like the sin and cos functions. The two functions can be combined to draw a train wheel:

The small break in the wheel is because the angle rotated from 0 to 6, not 6.28 (2*PI, really). The Min(0) and Max(6) parameters to the XY Function are required to specify the range of the independent parameter (angle, in this example). The curves are smooth because the functions subdivide the drawing just enough that any more would be wasted. Steps(5) should usually be left out; a large number of steps might be needed for some functions with discontinuities. Steps(N steps) or Inc(small step size) tells the code to subdivide the curve at least that much looking for weird stuff.

Search for “spiral” in the scripting index to find another fun example:

JMP 12 can make the cardioid this way:

New Window( "Heart",

Graph Box(

framesize( 300, 300 ),

X Scale( -4, 2 ),

Y Scale( -3, 3 ),

Pen Color( "red" ),

XY Function(

2 * Cos( t ) - Cos( 2 * t ),

2 * Sin( t ) - Sin( 2 * t ),

t, Min( 0 ), Max( 2 * Pi() ) )

)

)

Some where on the Blue Ridge Parkway, early 60's

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.