- #1
JazzMasterKC
- 19
- 0
0. The app does not have the template built in so ill do my best, sorry i don't have a computer right now.
1. This is a personal project, and there is a lot to it but I'm cutting out down to where i need help.
Imagine a 2x2 grid of squares (2d for now). The center vector is at (0,0), and the length of one side of a square is 1m (or just think of one, distance doesn't matter right now). So essentially the grid is 2m by 2m. Now a arrow/line is abstract so it can help us meassure the distance from the center to a point on the outer rim of the grid.. in otherwords think of this like the unit circle (trig) but in a square... This is actually the direction where an object will be projected but that's unrelated to my question.
2. So what i wanted was to obtain that length of arrow/line and actually the cordinates on the grid.. i can figure that out easily because I am given the angle of the arrow.. and yes so if the arrow is at the cordinate (0,1) that is a 90 degree angle. I can use a triangle for reference but since its a square i can't seem to figure out how to write a function that can pull this off from 0 degrees to 360.. every 45 degrees i have to switch which function it will use.. and I been using the tool of sin(A)/a=sin(B)/b.. as well as soh-cah-toa because i use the right angle to help me find the distance of the arrow.
3. So my question is how can i make this into one function rather then 8 different ones that switch after x amount of degrees. This is also a computer program so id like to keep it optimal.. my math course is entering calc 1 this fall so pre-calc.. I wonder if I'm not seeing something or is there other tools avaliable to help me figure this out?
Thanks
1. This is a personal project, and there is a lot to it but I'm cutting out down to where i need help.
Imagine a 2x2 grid of squares (2d for now). The center vector is at (0,0), and the length of one side of a square is 1m (or just think of one, distance doesn't matter right now). So essentially the grid is 2m by 2m. Now a arrow/line is abstract so it can help us meassure the distance from the center to a point on the outer rim of the grid.. in otherwords think of this like the unit circle (trig) but in a square... This is actually the direction where an object will be projected but that's unrelated to my question.
2. So what i wanted was to obtain that length of arrow/line and actually the cordinates on the grid.. i can figure that out easily because I am given the angle of the arrow.. and yes so if the arrow is at the cordinate (0,1) that is a 90 degree angle. I can use a triangle for reference but since its a square i can't seem to figure out how to write a function that can pull this off from 0 degrees to 360.. every 45 degrees i have to switch which function it will use.. and I been using the tool of sin(A)/a=sin(B)/b.. as well as soh-cah-toa because i use the right angle to help me find the distance of the arrow.
3. So my question is how can i make this into one function rather then 8 different ones that switch after x amount of degrees. This is also a computer program so id like to keep it optimal.. my math course is entering calc 1 this fall so pre-calc.. I wonder if I'm not seeing something or is there other tools avaliable to help me figure this out?
Thanks