JavaSketchpad Quick Reference

If you click on the links in this window, relevant extracts from the full documentation will appear in a separate, smaller window. You can leave that window open, move or resize it to taste and hide it behind other windows. It will reappear when you select more links.


Object Constructions
    P   o   i   n   t   s    
Point (x position, y position);

Freely draggable.
FixedPoint (x position, y position);

Not draggable.
Midpoint (segment);

Half-way on a segment.
Point on object (object, relative position);

Draggable, but restricted to a straight line or circle.
Intersect (straight1, straight2);

Intersection of two straight lines.
Intersect1 (straight, circle);

One intersection of a linear object, straight or circular, and a circle.
Intersect2 (straight, circle);

The other one.
PlotXY (y measure, coordinate system, x measure);

A point positioned by a measurement or calculation.
UnitPoint (point, pixels);

Point to the right of another point.
DriverPoint (x position, y position) [label ('name')];

Within a single JSP applet, a DriverPoint functions just like a Point. Other applets, however, can access a DriverPoint through its name and change its location.
    S   t   r   a   i   g   h   t       L   i   n   e   s    
Segment (point, point);

Straight line ending at the given points.
Ray (direction point, starting point);

Straight line starting at the second point and extending through the first.
Line (point, point);

Straight line extending through both points.
Perpendicular (line, point);

The perpendicular to the given line passing through the given point. Extends infinitely.
Parallel (line, point);

The parallel to the given straight line passing through the given point. Extends infinitely.
AxisX (coordinate system);

Horizontal axis. A plain, infinite line.
AxisY (coordinate system);

Vertical axis. A plain, infinite line.
    I   n   t   e   r   i   o   r   s    
Polygon (point, point, ...);

The interior area of the polygon defined by the given vertices.
Circle interior (circle);

The interior area of the given circle.
    C   i   r   c   l   e   s    
Circle (center point, radius point);

Circle by center point and a point on its edge.
Circle by radius (center, radius segment);

Circle defined by center point and some segment giving the radius length.
    T   r   a   n   s   f   o   r   m   a   t   i   o   n   s    
Reflection (object, line);

Some object reflected across a straight line.
Dilation (object, centre point, factor);

The original object dilated ("stretched") from the given point by the given factor.
Dilation/SegmentRatio
(object, center, s1, s2);

As above, but the scaling factor is calculated from the segments s1 and s2 as the ratio |s1|/|s2| .
Dilation/3PtRatio
(object, center, ratioA, ratioB, ratioC);

The "ratio" parameters are points A, B and C. The scaling factor is |AC|/|AB| . The sign of the scaling factor is negative if (A>B).(A>C) is negative.
Dilation/MarkedRatio
(object, center, factor measurement);

Dilation with a measurement rather than a fixed number as the scaling factor.
Rotation (object, center, angle/radians);

An object rotated around the center by the given angle.
Rotation/MarkedAngle
(object, center, angle start, angle center, angle end);

This time the angle is defined by three points.
Translation (object, x distance, y distance);

Translation by a fixed amount of pixels. Positive Y offsets translate towards the bottom of the screen.
VectorTranslation (object, foot point, tail point);

Translation by the vector extending from the given foot point to the tail point.
Translation/FixedAngle/MarkedDistance
(object, distance measure, angle/radians);

Translation by a vector supplied "in polar coordinates". The distance is variable (a measurement), the angle is constant (a number).
PolarTranslation (object, x distance, y distance);

The name is misleading. PolarTranslation is just a synonym to Translation. the two numbers are Cartesian, not polar offsets. If you want a translation with constant polar offsets, convert the numbers to a Cartesian offset and use Translation.
Translation/MarkedAngle/FixedDistance
(object, angle measurement, distance);

Translation by a vector supplied "in polar coordinates". The distance is constant (a number), the angle is variable (a measurement).
Translation/MarkedAngle/MarkedDistance
(object, angle measurement, distance measurement);

Translation by a vector supplied "in polar coordinates". Both distance and angle are variable (measurements).
    I   m   a   g   e   s    
Image (x position, y position, URL string);

A picture. The URL must an be absolute one using the http: protocol (the picture must therefore come from a server, not from your file system).
    M   e   a   s   u   r   e   m   e   n   t   s    
Length (segment, xpos, ypos, string);

The length of the given segment.
Angle
(angle start, angle center, angle end, xpos, ypos, string);

Measures the angle formed by the given three points.
Perimeter (polygon, xpos, ypos, string);

Measures a polygon's perimeter, given the interior.
Circumference (circle, xpos, ypos, string);

Length of a circle's circumference. Either the circle or its interior can be given.
Radius (circle, xpos, ypos, string);

Radius of a circle. Either the circle or its interior can be given.
Area (planar, xpos, ypos, string);

The Area of a circle, circle interior or polygon.
Slope (straight, xpos, ypos, string);

The slope of the given segment, ray or line.
Distance (object, point, xpos, ypos, string);

Distance of the point (2nd parameter) to the point, segment, ray or line (1st parameter).
Ratio/Segments (s1, s2, xpos, ypos, string);

s1 and s2 are segments. Calculates |s1|/|s2| .
Ratio/Points (A, B, C, xpos, ypos, string);

A, B, and C are points. Calculates |AC|/|AB| . The sign of the result is negative if (A>B).(A>C) is negative.
Coordinates (point, coordinate system, xpos, ypos, string);

Coordinates formatted as a pair of numbers in parentheses.
Calculate (xpos, ypos, prefix, expression) (measurements, ...);

Computes an expression from previously measured or calculated numbers. The list of measurements must have at least one (dummy) member.
Parameter (initial value, xpos, ypos, string);

A constant value that can only be changed from outside the applet.
    B   u   t   t   o   n   s    
ShowButton (xpos, ypos, label) (objects);

Shows the given objects.
HideButton (xpos, ypos, label) (objects);

Hides the given objects.
MoveButton (xpos, ypos, speed, label) (point pairs);

Moves the first point of each pair to the following point. (Speed in pixels per frame, applies to the slowest point. No extra parentheses for the pairs.)
AnimateButton (xpos, ypos, label) (point/path pairs)
(speeds) (once-only flags) (direction flags);

Animates the points along the paths (circles or straight lines)
    C   o   o   r   d   i   n   a   t   e       S   y   s   t   e   m   s    
Origin&Unit (origin point, unit point);

Coordinate system originating at the first point, unit length given by distance to second point.
UnitCircle (circle);

Center and unit distance taken from the circle.
    L   o   c   i    
Locus
(moved object, driver point, path, granularity);

Locus of the moved object (a point or straight line) created by moving the driver point along the cyclic or straight path.
Formats
To be supplied as a list in brackets [ ], e.g.  Point (10, 10) [hidden, red];
Named colours:
red, blue, magenta, cyan, green, black, white, yellow

All objects have a single colour. Labels are not affected.
RGB colours:
color (r, g, b)

r, g and b are fixed intensity values ranging from 0 to 255.
Line weights:
thick, thin

Thin is the default.
Visibility:
hidden

Makes an object invisible. It is not possible to hide a label without hiding its object.
Text suffixes:
suffix ('text')

Text to appear after the value of a measurement.
Auto-start:
auto

Instructs a button to be in active state at load time.
Labels:
label ('text')

Text to accompany a point. No other objects can have labels for now.
Traced objects:
traced

Instructs an object to leave traces and creates an X icon that can be clicked to clear the traces.


1. September 1998, Sebastian Lisken