Download or view SlideRule.frink in plain text format
/**
The fundamental equation of a slide rule on the C and D scales is:
distance1 = scale * log[n1/n0]
Where distance is the actual distance to mark a point with units of length
on a physical slide rule given an arbitrary dimensionless number n1 and a
"start point" dimensionless number n0 (which may be 1, or 1000 on large
circular slide rules?)
Scale is a scale with units of length, e.g. "scale = 10 inches" makes a
"10 inch slide rule" where a multiplicative scale of 10 from the start point
is 10 inches from the start point. This is interesting and gives an actual
physical scale to slide rules based on logarithms to base 10.
In log base 10 (log function):
distance1 === scale log[n1/n0]
n1 === n0 10^(distance1/scale)
scale = distance1 / log[n1/n0]
or, in natural log (ln function):
distance1 === scale ln[n1/n0] / ln[10]
n1 === n0 e^((distance1/scale) ln[10])
scale === distance1 ln[10] / ln[n1/n0]
WARNING: The equations below are not right and should be fixed.
For a circular slide rule, the radius probably should be written as an
Archimedan spiral:
See:
https://www.comsol.com/blogs/how-to-build-a-parameterized-archimedean-spiral-geometry/
radius = a + b theta
or
b = (radius2 - a) / (2 pi + theta1)
a === -2 b pi + radius2 + -1 b theta1
radius2 === a + 2 b pi + b theta1
theta1 === -1 a b^-1 + -2 pi + b^-1 radius2
or in [x, y] coordinates:
x = (a + b theta) cos[theta]
y = (a + b theta) sin[theta]
*/
p = new polyline
a = 1 inch
theta1 = 90 deg
radius2 = 2 cm
b = abs[(radius2 - a) / (2 pi + theta1)]
println["b is $b"]
for theta = 0 to 8 circle step 2 degree
{
x = (a + b theta) cos[theta]
y = (a + b theta) sin[theta]
p.addPoint[x,y]
}
p.show[]
Download or view SlideRule.frink in plain text format
This is a program written in the programming language Frink.
For more information, view the Frink
Documentation or see More Sample Frink Programs.
Alan Eliasen was born 20218 days, 0 hours, 2 minutes ago.