Welcome to our community

Be a part of something great, join today!

[SOLVED] Restricting Values in Desmos error (for a complicated parametric point).

Plasma

New member
Mar 11, 2018
8
Hello. I have graphed a rose curve on Desmos using a parametric point, the equation looking like this:

starhelp.PNG

However, I want the graph to be limited so that only values within the circle r=3.45 and r=9 are shown. I have tried using the curly brackets {3.45 <= r <= 9}, however this returns an error "You cannot multiply a point by a number". I have spent several hours searching for a fix to this, but to no avail. The built-in "t" restriction does not restrict the graph in this way, rather it deletes parts of it if the range is not at least 4. If anyone can help me restrict this function in such a way as to only show values within those circles, that would be very kind. Thank you!
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,590
Hello. I have graphed a rose curve on Desmos using a parametric point, the equation looking like this:

However, I want the graph to be limited so that only values within the circle r=3.45 and r=9 are shown. I have tried using the curly brackets {3.45 <= r <= 9}, however this returns an error "You cannot multiply a point by a number". I have spent several hours searching for a fix to this, but to no avail. The built-in "t" restriction does not restrict the graph in this way, rather it deletes parts of it if the range is not at least 4. If anyone can help me restrict this function in such a way as to only show values within those circles, that would be very kind. Thank you!
Hi Plasma , welcome to MHB! (Wave)

I think we need to split up the domain into 10 pieces to do it in Desmos.
That is, we need:
$$\frac{2\pi}{5}M+\arcsin\frac {2.8}{9} < t < \frac{2\pi}{5}M+\arcsin\frac {2.8}{3.45}$$
and:
$$\frac{2\pi}{5}M+\pi-\arcsin\frac {2.8}{3.45} < t < \frac{2\pi}{5}M+\pi -\arcsin\frac {2.8}{9}$$
We can do it in Desmos by for instance duplicating the formula 10 times with different restrictions on $t$.
At this time I don't see another way to do it more compactly with Desmos.

Alternatively we can do it here, on this website, directly with TikZ:
\begin{tikzpicture}[scale=0.3, ultra thick, red]
\foreach \M in {0,1,2,3,4} {
\draw[domain={72 * \M + asin(2.8 / 9)}:{72 * \M + asin(2.8 / 3.45)}, variable=\t]
plot ({\t}:{2.8 / sin(\t - 72 * \M)});
\draw[domain={72 * \M + 180 - asin(2.8 / 3.45)}:{72 * \M + 180 - asin(2.8 / 9)}, variable=\t]
plot ({\t}:{2.8 / sin(\t - 72 * \M)});
}
\end{tikzpicture}
[latexs]\begin{tikzpicture}[scale=0.3, ultra thick, red]
\foreach \M in {0,1,2,3,4} {
\draw[domain={72 * \M + asin(2.8 / 9)}:{72 * \M + asin(2.8 / 3.45)}, variable=\t]
plot ({\t}:{2.8 / sin(\t - 72 * \M)});
\draw[domain={72 * \M + 180 - asin(2.8 / 3.45)}:{72 * \M + 180 - asin(2.8 / 9)}, variable=\t]
plot ({\t}:{2.8 / sin(\t - 72 * \M)});
}
\end{tikzpicture}[/latexs]
Since TikZ works with degrees by default, I've converted your formula to use degrees, and I've used polar notation for the points.
 

Plasma

New member
Mar 11, 2018
8
Hi Plasma , welcome to MHB! (Wave)

I think we need to split up the domain into 10 pieces to do it in Desmos.
That is, we need:
$$\frac{2\pi}{5}M+\arcsin\frac {2.8}{9} < t < \frac{2\pi}{5}M+\arcsin\frac {2.8}{3.45}$$
and:
$$\frac{2\pi}{5}M+\pi-\arcsin\frac {2.8}{3.45} < t < \frac{2\pi}{5}M+\pi -\arcsin\frac {2.8}{9}$$
We can do it in Desmos by for instance duplicating the formula 10 times with different restrictions on $t$.
At this time I don't see another way to do it more compactly with Desmos.

Alternatively we can do it here, on this website, directly with TikZ:
\begin{tikzpicture}[scale=0.3, ultra thick, red]
\foreach \M in {0,1,2,3,4} {
\draw[domain={72 * \M + asin(2.8 / 9)}:{72 * \M + asin(2.8 / 3.45)}, variable=\t]
plot ({\t}:{2.8 / sin(\t - 72 * \M)});
\draw[domain={72 * \M + 180 - asin(2.8 / 3.45)}:{72 * \M + 180 - asin(2.8 / 9)}, variable=\t]
plot ({\t}:{2.8 / sin(\t - 72 * \M)});
}
\end{tikzpicture}
[latexs]\begin{tikzpicture}[scale=0.3, ultra thick, red]
\foreach \M in {0,1,2,3,4} {
\draw[domain={72 * \M + asin(2.8 / 9)}:{72 * \M + asin(2.8 / 3.45)}, variable=\t]
plot ({\t}:{2.8 / sin(\t - 72 * \M)});
\draw[domain={72 * \M + 180 - asin(2.8 / 3.45)}:{72 * \M + 180 - asin(2.8 / 9)}, variable=\t]
plot ({\t}:{2.8 / sin(\t - 72 * \M)});
}
\end{tikzpicture}[/latexs]
Since TikZ works with degrees by default, I've converted your formula to use degrees, and I've used polar notation for the points.
Thank you so much! I don't want to ask too much, since you've already helped me tremendously, but is there any way you can sort of explain how you got those restrictions / how to use TikZ for multiple equations? What I'm trying to accomplish is plotting several "stars" and creating a constellation using a graphing software. Otherwise you've been a lifesaver.
 
Last edited:

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,590
Thank you so much! I don't want to ask too much, since you've already helped me tremendously, but is there any way you can sort of explain how you got those restrictions / how to use TikZ for multiple equations? What I'm trying to accomplish is plotting several "stars" and creating a constellation using a graphing software. Otherwise you've been a lifesaver.
No problem at all.

You have:
$$
\mathbf r = \left(\frac{2.8\cos t}{\sin(t-\frac{2\pi}5M)}, \frac{2.8\sin t}{\sin(t-\frac{2\pi}5M)} \right)
= \frac {2.8} {\sin(t-\frac{2\pi}5M)}\left(\cos t, \sin t \right)
$$
Your formula means that the magnitude of $\mathbf r$ is:
$$r = |\mathbf r| = \frac{2.8}{\left|\sin(t-\frac{2\pi}5M)\right|}$$
And we want $3.45 < r < 9$, so let's solve:
$$
3.45 < \frac{2.8}{\sin(t-\frac{2\pi}5M)} < 9
\quad\Rightarrow\quad \frac{2.8}{9} < \sin\left(t-\frac{2\pi}5M\right) < \frac{2.8}{3.45} \\
\quad\Rightarrow\quad \arcsin\frac{2.8}{9} < t-\frac{2\pi}5M < \arcsin\frac{2.8}{3.45}
\quad \lor\quad \pi - \arcsin\frac{2.8}{3} < t-\frac{2\pi}5M < \pi - \arcsin\frac{2.8}{9} \\
\quad\Rightarrow\quad \frac{2\pi}5M + \arcsin\frac{2.8}{9} < t < \frac{2\pi}5M + \arcsin\frac{2.8}{3.45}
\quad\lor\quad \frac{2\pi}5M + \pi - \arcsin\frac{2.8}{3} < t < \frac{2\pi}5M + \pi - \arcsin\frac{2.8}{9}
$$
To be fair, I've left out some intermediate steps.
After all, I have no idea what your level of understanding of trigonometry is.
Either way, please let us know if any of these steps are unclear.


Btw, to create a 5-pointed star constellation with TikZ, we can do:
\begin{tikzpicture}
\usetikzlibrary{patterns}
\draw[pattern=fivepointed stars] (0,0) rectangle (3,3);
\end{tikzpicture}
[latexs]\begin{tikzpicture}
\usetikzlibrary{patterns}
\draw[pattern=fivepointed stars] (0,0) rectangle (3,3);
\end{tikzpicture}[/latexs]
 

Plasma

New member
Mar 11, 2018
8
No problem at all.

You have:
$$
\mathbf r = \left(\frac{2.8\cos t}{\sin(t-\frac{2\pi}5M)}, \frac{2.8\sin t}{\sin(t-\frac{2\pi}5M)} \right)
= \frac {2.8} {\sin(t-\frac{2\pi}5M)}\left(\cos t, \sin t \right)
$$
Your formula means that the magnitude of $\mathbf r$ is:
$$r = |\mathbf r| = \frac{2.8}{\left|\sin(t-\frac{2\pi}5M)\right|}$$
And we want $3.45 < r < 9$, so let's solve:
$$
3.45 < \frac{2.8}{\sin(t-\frac{2\pi}5M)} < 9
\quad\Rightarrow\quad \frac{2.8}{9} < \sin\left(t-\frac{2\pi}5M\right) < \frac{2.8}{3.45} \\
\quad\Rightarrow\quad \arcsin\frac{2.8}{9} < t-\frac{2\pi}5M < \arcsin\frac{2.8}{3.45}
\quad \lor\quad \pi - \arcsin\frac{2.8}{3} < t-\frac{2\pi}5M < \pi - \arcsin\frac{2.8}{9} \\
\quad\Rightarrow\quad \frac{2\pi}5M + \arcsin\frac{2.8}{9} < t < \frac{2\pi}5M + \arcsin\frac{2.8}{3.45}
\quad\lor\quad \frac{2\pi}5M + \pi - \arcsin\frac{2.8}{3} < t < \frac{2\pi}5M + \pi - \arcsin\frac{2.8}{9}
$$
To be fair, I've left out some intermediate steps.
After all, I have no idea what your level of understanding of trigonometry is.
Either way, please let us know if any of these steps are unclear.


Btw, to create a 5-pointed star constellation with TikZ, we can do:
\begin{tikzpicture}
\usetikzlibrary{patterns}
\draw[pattern=fivepointed stars] (0,0) rectangle (3,3);
\end{tikzpicture}
[latexs]\begin{tikzpicture}
\usetikzlibrary{patterns}
\draw[pattern=fivepointed stars] (0,0) rectangle (3,3);
\end{tikzpicture}[/latexs]
This makes sense to me, other than one small thing. I know it's necessary to have two restrictions, and I understand how you got the first one, but how did you get the second one? Other than that everything else works beautifully in Desmos. Truly, thank you :)
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
9,590
This makes sense to me, other than one small thing. I know it's necessary to have two restrictions, and I understand how you got the first one, but how did you get the second one? Other than that everything else works beautifully in Desmos. Truly, thank you :)
What do you mean by 'the 2nd one'?

I'm guessing you mean $\sin x=a \Rightarrow x=\arcsin a \lor x =\pi-\arcsin a$?
If that's the case, it follows from using the so called unit circle.
\begin{tikzpicture}[scale=3]
\draw circle (1);
\draw (-1.2,0) -- (1.2,0);
\draw (0,-1.2) -- (0,1.2);
\draw (0,0) -- node[above left] {1} (.86,0.5) -- (0,0.5) node[above right] {$a=\sin x$} -- (-.86,0.5) -- (0,0);
\node at (10:0.3) {$x$};
\node at ({180-10}:0.3) {$\pi-x$};
\end{tikzpicture}
That is, the solution to $\sin x =a$ is $x=\arcsin a \lor x =\pi-\arcsin a$ assuming $0\le x <2\pi$.
After all, there are 2 angles that yield the same sine.