Can someone please send me a code sniplet of how to calculate the angle from one point of the form and another point? Thanks
Printable View
Can someone please send me a code sniplet of how to calculate the angle from one point of the form and another point? Thanks
You can't do it directly like that. You'll need a 3rd point to act as a reference point for the other 2. Then you can get the angle between them. Such an angle doesn't exist unless that reference point exists. It's easy to find that angle once you have that point though. Depending on how you define your coordinate system, you can make things easy or hard :). This is a very simple example, but it should show you all that's necessary for you to develop the ability to work with any sort of differing orientations and whatnot. I've attached a little jpg of a diagram, and it has the calculations as you'd use them in VB.