Jump to content
  • Advertisement


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


Problem With Pythagorean Theorem

This topic is 5933 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
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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!