How to rotate a line based dimensions of a piece of paper

238 Views Asked by At

I have a line where I know the start and end point on a piece of paper with the dimensions of 8 1/2 inches x 11 inches.

the start point is 5.6 inches from the right of the paper and 4 inches down from the paper.

the end point is 6.1 inches from the right of the paper and 3.15 inches down from the paper.

I want to rotate the line 60 degrees from each side of the line and reduce the length to .3 inches to its original length.(to form an arrowhead)

I have no clue on how to go about doing this or if its even possible help would be much appreciated.

2

There are 2 best solutions below

3
On

A figure always helps is such cases, with coordinates: do you mean that your points are like this (figure done by Geogebra) with $E(2.9, 4)$ and $F(2.4, 3.15)$ ?

enter image description here

1
On

Break the task down into steps. Let’s call the start point of your line segment $S$ and the end point $E$.

It’ll be easier to get a line segment of the proper length first, before rotating. The line segment that you’ll be rotating to form the arrowhead starts at $E$ and goes a distance of 0.3 toward $S$, so its end point will be at $A=E+{0.3\over|S-E|}(S-E)$, where $|S-E|$ means the distance between $S$ and $E$.

Now that you’ve got a line segment of the correct length, you need to rotate that around the point $E$. Again, break this down into separate steps: translate the origin to this point, rotate and finally translate back. For the first translation, we want the coordinates of $E$ to end up being $(0,0)$, so subtract $E$ from everything. The endpoint of the short arrowhead segment becomes $P=A-E$.

When you rotate a point $(x,y)$ counterclockwise through an angle $\theta$ around the origin, its new coordinates $(x',y')$ will be $$\begin{align}x'&=x\cos\theta-y\sin\theta\\y'&=x\sin\theta+y\cos\theta\end{align}.$$ For a 60-degree angle, the cosine is equal to $\frac12$ and the sine is equal to $\frac{\sqrt3}2$, while for an angle of -60 degrees, the values are $\frac12$ and $-\frac{\sqrt3}2$, respectively.

Finally, you translate back, which just involves adding the coordinates of $E$ back in. Putting these three steps together together, once you have the end point $A=(x_A,y_A)$ that you computed at the top, the coordinates of the rotated versions of this point are $$\left(x_E+\frac12(x_A-x_E)-\frac{\sqrt3}2(y_A-y_E),y_E+\frac{\sqrt3}2(x_A-x_E)+\frac12(y_A-y_E)\right)$$ and $$\left(x_E+\frac12(x_A-x_E)+\frac{\sqrt3}2(y_A-y_E),y_E-\frac{\sqrt3}2(x_A-x_E)+\frac12(y_A-y_E)\right).$$

Notice that we added $E$ to something to get $A$, but then we immediately subtract $E$ from that for the rotation. You can save yourself a little work by computing only $B={0.3\over|S-E|}(S-E)$ and plugging that directly into the rotation formulas, giving: $$\left(x_E+\frac12x_B-\frac{\sqrt3}2y_B,y_E+\frac{\sqrt3}2x_B+\frac12y_B\right)$$ and $$\left(x_E+\frac12x_B+\frac{\sqrt3}2y_B,y_E-\frac{\sqrt3}2x_B+\frac12y_B\right).$$ To complete this, let’s write out $B$ explicitly. The length of a line segment in terms of its coordinates is given by the Pythagorean theorem, i.e., $|S-E|=\sqrt{(x_S-x_E)^2+(y_S-y_E)^2}$, so we have $$\begin{align}x_B&={0.3(x_S-x_E)\over\sqrt{(x_S-x_E)^2+(y_S-y_E)^2}}\\y_B&={0.3(y_S-y_E)\over\sqrt{(x_S-x_E)^2+(y_S-y_E)^2}}.\end{align}$$


Taking the points in your question as an example, we have $S=(5.60,4.00)$ and $E=(6.10,3.15)$, so $S-E=(-0.500,0.850)$ and $|S-E|=\sqrt{(-0.500)^2+0.850^2}=0.986$. This gives $B=0.30\,/\,0.986\cdot(-0.500,0.850)=(-0.152,0.258)$.

Your page coordinate system is rotated 180° from the usual orientation, but that doesn’t really affect the calculations. The rotated versions of $B$ are $$(-0.152\cdot0.5-0.258\cdot0.866,-0.152\cdot0.866+0.258\cdot0.5)=(-0.300,-0.002)$$ and $$(-0.152\cdot0.5+0.258\cdot0.866,-0.152\cdot(-0.866)+0.258\cdot0.5)=(0.148,0.261)$$ and, finally, the endpoints of the two arrowhead segments are $$(6.10,3.15)+(-0.300,-0.002)=(5.80,3.15)$$ and $$(6.10,3.15)+(0.148,0.261)=(6.25,3.41).$$ If you plot these line segments, you get something like this:enter image description here