pointtopoint()
#4

Quote:
Originally Posted by legodude
Посмотреть сообщение
isnt that pythagoras?
Pythagoras:
aІ+bІ=cІ

We've got:
xІ+yІ+zІ=aІ

It has it's origin from Pythagoras, but we just added another dimension.
Proof that it works:

Imagine the world would be a coordination system. We've got a triangle, so we first use Pythagoras to get the distance of the points on the ground level:
xІ+yІ=d(xy)І

d(xy) means the distance, from X to Y.

Now, when we've got the ground level, we add the altitude, Z. We get this:

d(xy)І+zІ=d(xyz)І

Now we can easily replace d(xy)І with xІ+yІ. What we get looks like this:

xІ+yІ+zІ=d(xyz)І

We want d(xyz), not d(xyz)І, so we use the squareroot. Now we've got:

√(xІ+yІ+zІ) = √d(xyz)І = d(xyz)

I don't know if this was necessary for you, but it might help some people to understand the background of the code.
Reply


Messages In This Thread
pointtopoint() - by legodude - 06.11.2010, 16:58
Re: pointtopoint() - by Mauzen - 06.11.2010, 17:04
Re: pointtopoint() - by legodude - 06.11.2010, 17:56
Re: pointtopoint() - by DeathOnaStick - 06.11.2010, 18:35
Re: pointtopoint() - by legodude - 06.11.2010, 19:09

Forum Jump:


Users browsing this thread: 2 Guest(s)