3d Pictures
3D pictures
space3d
Starts a picture of 3D space, drawn in perspective and turned so the axes read as in the textbook: z up, x towards you, y to the right. Add to it with axes3d, point3d, segment3d, arrow3d, face3d, plane3d, angle3d and label3d; turn it with view3d.
size (number) -- optional: the space shown runs from -size to size on each axis (5)
yaw (number) -- optional: degrees turned about the vertical axis (-35)
pitch (number) -- optional: degrees tipped towards you, so you look down on it (20)
axes3d
Draws the x, y and z axes as labelled arrows from the origin O, their negative halves dashed.
d (diagram) -- a picture made by space3d
length (number) -- optional: how far each axis runs (0.9 of the size)
point3d
Marks a point with a dot and, if given, its name beside it.
d (diagram) -- a picture made by space3d
p (vector) -- the point, vec(x, y, z)
label (string) -- optional: its name, such as "P"
color (string) -- optional: a CSS colour
segment3d
Draws the straight line from p to q, solid or dashed (for a perpendicular or a projection).
d (diagram) -- a picture made by space3d
p (vector) -- one end
q (vector) -- the other end
color (string) -- optional: a CSS colour
style (string) -- optional: "dashed" or "solid"
arrow3d
Draws a vector as an arrow from one point to another, its head a cone drawn as it is seen, with an optional name at the tip.
d (diagram) -- a picture made by space3d
from (vector) -- the tail
to (vector) -- the tip
color (string) -- optional: a CSS colour
label (string) -- optional: its name, such as "F"
face3d
Draws a flat polygon through three or more points in order, shaded by how it faces the light. A colour and an opacity may follow the points.
d (diagram) -- a picture made by space3d
p1, p2, p3, ... (vector) -- the corners, in order round it
color (string) -- optional: a CSS colour
opacity (number) -- optional: 0 (clear) to 1 (solid), 0.55
plane3d
Draws a square piece of the plane through a point with a given normal, see-through so what is behind shows.
d (diagram) -- a picture made by space3d
normal (vector) -- a normal to the plane, such as vec(1, 2, 2) for x + 2y + 2z = d
p (vector) -- a point of the plane, the middle of the square
color (string) -- optional: a CSS colour
opacity (number) -- optional: 0 to 1 (0.45)
half (number) -- optional: half the side of the square (0.8 of the size)
angle3d
Marks the angle p-at-q with an arc at `at` and writes its size in degrees, measured from the points, unless a label is given.
d (diagram) -- a picture made by space3d
at (vector) -- the vertex
p (vector) -- a point on one arm
q (vector) -- a point on the other arm
label (string) -- optional: the text instead of the measured size, such as "θ"
label3d
Writes text at a point in space.
d (diagram) -- a picture made by space3d
p (vector) -- where
text (string) -- the text
color (string) -- optional: a CSS colour
view3d
Turns the camera: change yaw from frame to frame to spin the picture round the vertical axis.
d (diagram) -- a picture made by space3d
yaw (number) -- degrees about the vertical axis
pitch (number) -- degrees tipped towards you
curve3dOn
Draws a curve in space from three formulas in t, for t from t0 to t1: a helix, a wave, a path. Arrowheads along it can show the way it runs. The formulas are kept as written; t is the curve's own and the script's t is left as it was.
d (diagram) -- a picture made by space3d
x (string) -- x as a formula in t, such as "cos(t)"
y (string) -- y as a formula in t
z (string) -- z as a formula in t
t0 (number) -- where t starts
t1 (number) -- where t ends
color (string) -- optional: a CSS colour
marks (number) -- optional: how many arrowheads along it (0)
n (number) -- optional: how many steps (240)
revolve3d Apas Cloud
Draws the solid made by turning the region under y = outer(x), for x from a to b, about the x axis (the disc method); with an inner curve, the solid between the two (the washer method), with its hole. The end faces are drawn and the curves turned are marked in red in the xy plane. See-through (opacity 0.45 unless given). Turn the camera with space3d's yaw (75 puts x to the right). An axis may follow (E47): "y = 2" or "x = -1" or "y-axis"; then the curves are y = f(x) (or x = g(y), written in y) and the radii are their distances from that line, which is drawn; give "" for no inner curve before it.
d (diagram) -- a space3d picture
outer (string) -- the outer radius as a function of x, in quotes
a (number) -- from x = a
b (number) -- to x = b
inner (string) -- optional: the inner radius (the hole)
color (string) -- optional
opacity (number) -- optional: 0 to 1
axis (string) -- optional: the line turned about, "x-axis" (default), "y = c", "x = c" or "y-axis"
crossSections3d Apas Cloud
Draws a solid with known cross sections: the base region between y = bottom(x) and y = top(x), for x from a to b, in the floor (z = 0), and n slices standing on it across the region at the middles of n equal parts: "square", "semicircle" (its diameter across the base), "equilateral" (triangle) "rectangle" (k times as high as wide), "isosceles-leg" (a right isosceles triangle with a leg on the base) or "isosceles-hypotenuse" (with its hypotenuse on the base).
d (diagram) -- a space3d picture
top (string) -- the upper edge of the base, a function of x in quotes
bottom (string) -- the lower edge
a (number) --
b (number) --
n (number) -- how many slices, 1 to 60
shape (string) -- "square", "semicircle", "equilateral" "rectangle", "isosceles-leg" or "isosceles-hypotenuse"
color (string) -- optional
k (number) -- optional: a rectangle's height over its width (default 1)
3D pictures
fieldLines3d
Draws point charges and the electric field lines between them in space, each line with an arrowhead the way the field points (from + to −). The field is the normalised Coulomb field, E = Σ q r/r³; lines leave each positive charge evenly in all directions, as many as per_charge × |q|.
d (diagram) -- a picture made by space3d
charges (array) -- [x, y, z, q, ...]: four numbers for each charge
per_charge (number) -- optional: lines for each unit of charge (8)
color (string) -- optional: the lines' colour
model3d
A molecule in 3D as a ball-and-stick (or space-filling) picture, from its real shape: the built-in set is PubChem's computed 3D conformers, checked against the textbook's bond lengths and angles. Built in: ethane, butane, cyclohexane, ethene, ethyne, benzene, methanol, ethanol, acetic acid, glucose (beta-D-glucopyranose), alanine (L), d-alanine, lactic acid (L), d-lactic acid, glycine, adenine, thymine, guanine, cytosine. Atoms are numbered from 1 as in the molfile. Turn a bond with torsion3d, measure with dihedral3d, mirror with mirror3d, look down a bond with viewAlong3d.
molecule (string) -- a built-in name, or a V2000 molfile's text with 3D coordinates
yaw (number) -- optional: degrees turned about the vertical axis (20)
pitch (number) -- optional: degrees tipped towards you (15)
style (string) -- optional: "sticks" (ball and stick) or "fill" (space-filling, van der Waals radii)
torsion3d
Turns the atoms on j's side of the bond i-j about that bond by the given degrees; bond lengths and angles stay as they are. A bond in a ring is refused.
m (diagram) -- a molecule made by model3d
i (number) -- the atom that stays
j (number) -- the atom whose side turns
degrees (number) -- the turn; positive is anticlockwise looking from j back to i
dihedral3d
The dihedral (torsion) angle a-i-j-b in degrees, between -180 and 180, measured from the positions: 60 is gauche or staggered, 180 anti, 0 eclipsed.
m (diagram) -- a molecule made by model3d
a (number) -- an atom bonded to i
i (number) -- the bond's near atom
j (number) -- the bond's far atom
b (number) -- an atom bonded to j
conformation3d
Ethane (H-C-C-H) or butane (C-C-C-C) turned to the given dihedral, with the dihedral and its name (staggered, eclipsed, anti, gauche) written under the picture.
molecule (string) -- "ethane" or "butane"
degrees (number) -- the dihedral: butane 180 anti, 60 gauche, 120 eclipsed, 0 fully eclipsed
yaw (number) -- optional (0)
pitch (number) -- optional (15)
mirror3d
The mirror image of a molecule as a new picture, for chirality: L-alanine and its mirror image (D-alanine) side by side. The original is unchanged.
m (diagram) -- a molecule made by model3d
viewAlong3d
Turns the camera to look from atom i straight down the bond to atom j: the Newman view, in 3D.
m (diagram) -- a molecule made by model3d
i (number) -- the near atom
j (number) -- the far atom
dna3d
The B-DNA double helix of a strand and its partner, as in NCERT XII Biology Fig. 5.3: two sugar-phosphate backbones, right-handed, 0.9 nm from the axis; each base pair a bar across, half in each base's colour (adenine yellow, thymine green, guanine orange, cytosine red); A pairs with T and G with C; 0.34 nm and 36° from one pair to the next, so 10 pairs make a 3.4 nm turn. The backbones stand 144° apart across the minor groove, so the major and minor grooves show. 5′ and 3′ mark the ends: the strands run opposite ways. Units are nm, the axis along z.
d (diagram) -- a picture made by space3d (size about half the helix's height in nm)
sequence (string) -- the first strand, 5′ to 3′ going up: A, T, G, C (1 to 60 bases)
bottom (vector) -- optional: where the axis starts (the helix is centred on the origin)