# Rigid transformation and rotation of polygon in graph

**URL:** <https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482>\
**Category:** Questions\
**Created:** [June 10, 2021, 6:11pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482 "2021-06-10T18:11:59Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 10, 2021, 6:11pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/1 "2021-06-10T18:11:59Z")

</div>

I would like to create a polygon in a graph and have students be able to move the polygon and rotate it. I know how to do it if the polygon is a .jpg but not a polygon that I build. How do I make it rigid and floating?

Thank you!!!

I just figured out how to do the rigid movement, now I just need the rotation of the piece - hopefully with just a click on the polygon and not dragging a point.

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [June 10, 2021, 6:51pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/2 "2021-06-10T18:51:24Z")

</div>

I have a rotation example [saved in my graphs here](https://www.desmos.com/calculator/yc5ithowp2) that might help. I’m not sure that you can click and rotate a polygon in a graph (yet), so would it work for you if the rotation is controlled by a button click?

---

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 10, 2021, 7:03pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/3 "2021-06-10T19:03:45Z")

</div>

Yes, a button click to do the rotation (without animation) would work.

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [June 10, 2021, 9:18pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/4 "2021-06-10T21:18:54Z")

</div>

There are lots of ways to take this from here, so let me know if this isn’t what you’re looking for.

> **[Rotating Polygon • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/60c27fd1cac02a4768893ceb)**
>
> by Craig Winske

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [June 11, 2021, 12:50pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/5 "2021-06-11T12:50:12Z")

</div>

I actually got the polygon to rotate just by dragging a point. I updated the previous activity to include that on screen 2.

---

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 11, 2021, 2:02pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/6 "2021-06-11T14:02:07Z")

</div>

That is perfect! Thank you!!!

---

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 11, 2021, 2:40pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/7 "2021-06-11T14:40:50Z")

</div>

What you did on slide 2 is kind of what I am looking for. However, when I try to translate your code to my code, I’m getting lost. I have attached a copy of my code (slide 3). I have it set so that dragging the blue point will allow rigid movement. I would like the student to be able to use the green point to rotate the triangle about the blue point. Is this possible?

> **[\[Copy of\] Rotating Polygon • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/60c36d012f6d3b2835337c70)**
>
> by Pamela Davis

Thank you so much for your assistance!!!

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [June 11, 2021, 7:51pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/8 "2021-06-11T19:51:40Z")

</div>

Whew, this was a good mental exercise! I haven’t done this much trig in a long time! Check screen 3 of the original activity.

---

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 12, 2021, 4:21pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/9 "2021-06-12T16:21:06Z")

</div>

Thank you! That is exactly what I wanted.

I’m trying to make multiple triangles and I have been successful in making a second triangle with adjustments to the coding except for the point of rotation. I don’t understand the meaning so I don’t know how to adjust it. Can you help me understand these two lines:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/3/336b6efa964505457ee0a0afd64d63209213bf53.png)

Thank you for all of your time and work that you have done for me!

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [June 12, 2021, 7:25pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/10 "2021-06-12T19:25:39Z")

</div>

Sorry, I should have generalized the `R` variable for you so that all you had to do was change variable names. The first expression should be ok to use, but I’ll explain what each part is. The entire thing is just a pair of expressions that creates a point to trace a parametric circle based on the slider `a_2`. Make sure to long press on the colorful dot and turn on the option to drag the point. If you replace each `a_2+R_2` with `t`, you will see the circle that the point traces. It should look like this:  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/5/5d2c425a263eb54ad343f802834ee9ef6c6d41c3.png)  
The circled parts in the next image shows where the point of rotation will be. This is what I visualized the center of the circle to be in the first image.

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/8/8292cd6caf5db3f5b528d03825c1f8e1e1f303a1.png)  
The circled parts in the next image calculates the length of the radius of the circle.  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/1/1f7f7aaa2e58702bd84a09af765d3e4e34a7a076.png)  
Finally, the `a_2+R_2` calculates the angle that is created as seen in this image (thinking of this like a unit circle). If `R_2` were zero, the blue point would be roughly located at (9.9,4).  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/b/b517d6a9713d9a83495506f27b23d68c1199b7f7.png)

The only thing that’s preventing your graph to work is to calculate that angle. To do this, I used the idea on how to find the angle between two vectors. If you use this for `R\_2, it should (hopefully) work for you.  
 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/0/04357d1ea6eabce71813f261a49edfe0c6dfb5f5.png)

---

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 12, 2021, 8:05pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/11 "2021-06-12T20:05:05Z")

</div>

Thank your for explaining and helping me. I tried the new code for R\_2 and I’m getting an error: cannot access a coordinate of a number. I’m not sure what that means or what to adjust.

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [June 12, 2021, 10:06pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/12 "2021-06-12T22:06:15Z")

</div>

Something is possibly mislabeled in what I sent you. Can you share the screen so I can see the labels of the other variables? I was kind of guessing based on what you sent before.

---

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 12, 2021, 10:32pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/13 "2021-06-12T22:32:36Z")

</div>

It’s slide 4: [1.1: Investigation 9 • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/60c2269eae15ce04da71b4b2?collections=60a7d216413b9807ff9327c5)

Thank you, again!!!

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [June 12, 2021, 11:32pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/14 "2021-06-12T23:32:10Z")

</div>

The problem was hard to catch, but it looked like one of the `V_{2a}` variables wasn’t quite formatted correctly (the `a` wasn’t subscript). I also had to subtract the `R_2` variable from 2pi since it was a reflex angle. [Here’s a link to the graph](https://www.desmos.com/calculator/oznnkdjr2z). You can just the url and paste it into an open expression line in your activity and the graph will overwrite anything you previously had there.

---

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 12, 2021, 11:34pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/15 "2021-06-12T23:34:51Z")

</div>

I don’t know how to thank you enough! That is perfect. I am learning so much from all of you!

---

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 15, 2021, 4:58pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/16 "2021-06-15T16:58:59Z")

</div>

I finally have everything programed and as I was checking, I found an error. For some reason, triangles 1,3, and 4 are linked together and the rotating point for triangle 3 is not locked to vertex B and this point is controlling the rotation for all three triangles. I keep looking at my code and even redoing the code for these three triangles and I’m not finding the error. Slide 3.

> **[1.1: Investigation 9 • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/60c2269eae15ce04da71b4b2)**
>
> by Pamela Davis

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [June 16, 2021, 1:27pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/17 "2021-06-16T13:27:15Z")

</div>

This looks really nice! I noticed a few subscripts were missing on the problematic triangles for the `a` variable. This should work now. [Graphing Calculator](https://www.desmos.com/calculator/izlib7snoa)

---

<div class="post-metadata">

**Author:** ![Pamela\_Davis](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/pamela_davis/32/1890_2.png) [@Pamela\_Davis](https://cl.desmos.com/u/Pamela_Davis)\
**Post date:** [June 16, 2021, 2:18pm UTC](https://cl.desmos.com/t/rigid-transformation-and-rotation-of-polygon-in-graph/3482/18 "2021-06-16T14:18:12Z")

</div>

Thank you! I kept looking for the subscripts because I knew that had to be it but I just couldn’t find them! Thank you again for all of your assistance!!!
