Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

rjahrman

Problem With Pythagorean Theorem

This topic is 5846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have this code in my 2D C++ game to find the distance between the mouse and a point on the screen (myp_-scrl_off):
intholder[1] = sqrt( ( (mousex - (mypx-scrlxoff))^2 + (mousey - (mypy-scrlyoff))^2 ) ); 
It gives me messed up numbers. I punched hypothetical numbers into my calculator and it worked (I think). It must be the code...what''s wrong?

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by ZealousElixir
Geeezz...how did I miss that?! Thanks Burning.

*goes off to get some rest*


UhOh, Zealous is getting sloppy in his old age =)

*grins* - j/k. I didn''t even KNOW that ''^'' didn''t work for powers, and you''ve helped me plenty of times.





~~~~~~~~~~~
Chris Vogel
~~~~~~~~~~~

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!