I'm learning to code the equation for a logarithmic spiral for a graphics visualization. However, it appears to be inverted with the radius getting smaller (rather than larger) toward the outside of the curve. How can I invert the result so the radius gets larger as the curve moves outward?
var theta = 1; // begin at theta 1
for (var p = 0; p < particleCount; p++) {
// LOG SPIRAL SHAPE
var a = 500; // a constant
var b = 0.2; // another constant
var pX = a * Math.cos(theta) * Math.log(b * theta);
var pY = a * Math.sin(theta) * Math.log(b * theta);
theta += 1; // increment theta
// place an image at pX,pY and repeat
Since a picture is worth a thousand words (or lines of code), here is the result: