Formula to calculate co-ordinates in a grid for the start point and end points of a line as it rotates through 360 Degrees

CasualDabbler

New Member
Joined
Oct 29, 2018
Messages
19
Office Version
  1. 2016
Platform
  1. Windows
Hi all,
I'm looking for a formula that can generate the x,y co-ordinates within a 14x14 grid of a start (St) and end (Ed) point of a line
I'm looking for something that can calculate these points as the line rotates through 360 degrees
The starting point 0 degrees is a horizontal line from left to right in the middle of the grid.
The pictures below, should be a reasonable interpretation of what Im looking for - Thanks

1658313682823.png
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
There are a couple of details that need to be clarified. Are you always planning to rotate about a fixed point? I'm guessing that is the point (7,7) on your grid. And is the line supposed to be of some fixed length? Given a horizontal starting position shown in the first example, the "start" and "end" points would never reach (0,0) and (14,14). And what are your input controls for the line...do you specify an angle and rotation direction, a start point with a fixed rotation point, etc.?
 
Upvote 0
HI Kirk, thanks for looking at my query
yes, it rotates about a fixed point 7,7
Line is not a fixed length (I get what your saying - the diagonal line would need to be longer that when its vertical or horizontal)
It more about where the ST & ED points would be along the outside edge of the grid.
*If its easier to be a fixed length, thats ok as long as the line always hits the edge of the grid. I.e. The points when the line was less than diagonal could go outside of the grig I.e St (-2,7) ED (16,7)​
The input is degrees 0-360 rotation is clockwise, starting points at 0 degrees are as per the 1st image [ST(0,7) / ED(14,7)]

Looking for math / formula, that give me new co-ordinates or an offset from the starting point
i.e.
IF Degrees = 90 STx offset is 0 and STy offset is -7 / EDx offset is 0 and EDy offset is +7
But a formula that would work for any degree input

Thanks
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top