Title: | Mathematics at DEC |
Moderator: | RUSURE::EDP |
Created: | Mon Feb 03 1986 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 2083 |
Total number of notes: | 14613 |
I'm drawing a logarithmic spiral as defined in polar coordinates by the equation: r = a * exp(t) Where a is a constant, and r is the radius, t the angle. This is a convenient parametric form and I can readily compute (x,y) coordinates via the standard substitutions (x,y) = (r cos(t),r sin(t)). Trouble is I also want to occasionally draw a tangent to the spiral for a few (random) values of t. But since the equation is in polar form (and not really even a function!) I don't remember how to go about calculating the derivative. Anybody happen to remember enough calculus to help out here? John
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1910.1 | SWAG | AUSSIE::GARSON | achtentachtig kacheltjes | Sun Nov 20 1994 21:13 | 14 |
re .0 I think you can *informally* deal with this using the following. dy dy dx -- = -- / -- dx dt dt Substituting everything in should eventually give you dy/dx as a function of t. For your particular function I get dy/dx = (sin t + cos t)/(cos t - sin t) and I think that probably simplifies but I can't remember my trig formulae. dy/dx = tan(t+pi/4) ? | |||||
1910.2 | WRKSYS::ROTH | Geometry is the real life! | Mon Nov 21 1994 15:44 | 19 | |
You could just take the velocity vector and normalize it to a unit vector to get the tangent P(t) = (a exp(t) cos(t), a exp(t) sin(t)) V(t) = (a exp(t) (cos(t) - sin(t)), a exp(t) (sin(t) + cos(t))) V(t) doesn't vanish away from the origin so the x and y components can be normalized. You could even do something sleazy like make a small change up and down in t and use central differences to approximate the derivative to second order accuracy if you don't want to figure it out :-) This example is trivial, but I've often had complicated functions and have compared the numerical estimate with the analytic derivative to check on mistakes in the latter. - Jim | |||||
1910.3 | AUSSIE::GARSON | achtentachtig kacheltjes | Mon Nov 21 1994 16:21 | 5 | |
additional to .1 .2 reminds me to observe that the velocity vector makes a constant angle with the position vector (in this case pi/4) which I believe is characteristic of a logarithmic spiral. |