Fermat's spiral is a special type of Archimedean spiral. Archimedean spirals are described by the equation r = a * (theta^(1/n)), where "r" is the radial distance, "theta" is the polar angle and "n" is a constant that alters how tightly the spiral is wrapped. When n = 2, r^2 = a^2 * theta, and the spiral is called Fermat's spiral. For any given positive value of theta, there are two values of "r": r = a * (theta^(1/2)) and r = -a * (theta^(1/2)). This results in a symmetrical spiral about the origin.
MATLAB is a software application developed by MathWorks for technical computing. Many scientists and engineers use MATLAB to perform data analysis and data visualisation. You can use MATLAB to plot Fermat's spiral.
- Skill level:
- Moderately Easy
Other People Are Reading
Type "a = 2" in the Command window.
Type "theta = 0:(2pi)/100:(10pi)" to generate a range of values of "theta."
Type "r_pos = a * (theta.^(1/2))" to calculate the positive value of "r" for each value of "theta."
Type "r_neg = -a * (theta.^(1/2))" to calculate the negative value of "r" for each value of "theta."
Type "polar(theta,r_pos,'k-')" to plot the positive part of the spiral on polar coordinates in black.
Type "hold on, polar(theta,r_neg,'r-')" to plot the negative part of the spiral on the same polar coordinates in red.
Tips and warnings
- You can also plot Fermat's spiral on Cartesian coordinates instead of polar coordinates. Once you have calculated your values of "theta," "r_pos" and "r_neg," convert them to Cartesian coordinates using the "Pol2cart" function, e.g. "[x_pos, y_pos] = pol2cart(theta,r_pos)." Then plot the points using the "Plot" function, e.g. type "plot(x_pos, y_pos)." Repeat the same steps for the positive part of Fermat's spiral.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for