http://nickpisca.com/BLAST/index.php?title=CSharp_ConvertVectorToAngle&feed=atom&action=history
CSharp ConvertVectorToAngle - Revision history
2024-03-28T17:34:57Z
Revision history for this page on the wiki
MediaWiki 1.28.1
http://nickpisca.com/BLAST/index.php?title=CSharp_ConvertVectorToAngle&diff=35&oldid=prev
Nickpisca: Created page with " static double ConvertVectorToAngle(double x, double y) { double WinAngle = 0.0; if (x == 0.0) { if (y..."
2017-04-22T05:01:15Z
<p>Created page with " static double ConvertVectorToAngle(double x, double y) { double WinAngle = 0.0; if (x == 0.0) { if (y..."</p>
<p><b>New page</b></p><div> static double ConvertVectorToAngle(double x, double y)<br />
{<br />
double WinAngle = 0.0;<br />
if (x == 0.0)<br />
{<br />
if (y > 0)<br />
{<br />
WinAngle = 90.0;<br />
}<br />
else<br />
{<br />
WinAngle = 270.0;<br />
}<br />
}<br />
else<br />
{<br />
WinAngle = Math.Abs(Math.Atan(Math.Abs(y) / Math.Abs(x))) * 180.0 / Math.PI;<br />
if ((x >= 0) && (y >= 0))<br />
{<br />
//WinAngle = WinAngle;<br />
}<br />
else if ((x < 0) && (y >= 0))<br />
{<br />
WinAngle = 180.0 - WinAngle;<br />
}<br />
else if ((x < 0) && (y < 0))<br />
{<br />
WinAngle = WinAngle + 180.0;<br />
}<br />
else<br />
{<br />
WinAngle = 360.0 - WinAngle ;<br />
} <br />
<br />
}<br />
<br />
<br />
<br />
return WinAngle;<br />
}<br />
<br />
<br />
<br />
<br />
<br />
''This subroutine was used in the development of the [http://0001design.com/?page_id=199 Mega-Dots World's Toughest Connect-the-Dots Puzzles].<br />
<br />
''Unrelated MEL scripting help located here: [http://stores.lulu.com/nickpisca YSYT]. <br />
[[Category:CSharp]]</div>
Nickpisca