MySQL Forums
Forum List  »  Newbie

Re: SQRT / Pythagoras Query problem
Posted by: Peter Brawley
Date: May 14, 2014 03:37PM

The formula's ok:

insert into loc (a_name, a_x, b_x, a_y, b_y) values( 'test', 0, 3, 0, 4);
select sqrt( ((a_x - b_x) * (a_x - b_x)) + ((a_y - b_y) * (a_y - b_y)) ) as hypot from loc;
+-------+
| hypot |
+-------+
|     5 |
+-------+

Options: ReplyQuote


Subject
Written By
Posted
Re: SQRT / Pythagoras Query problem
May 14, 2014 03:37PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.