finding the difference between two coordinates

24 views
Skip to first unread message

alessia...@gmail.com

unread,
Dec 7, 2016, 4:40:33 AM12/7/16
to Python Programming for Autodesk Maya
Hi,

this maya be a dumb question. I basically have two points in space a(1,2,3) and b(-2,4,7) and i want to find out what values i need to add to the 'a' coordinates to get to the 'b' coordinates. If i subtract then it would give me (1-(-2)),(2-4),(3-7) = (3,-2,-4).

but then if i add these difference values back on top of the 'a' coordinates i wont get (-2,4,7), i get (4,0,-1)

this is probably a simple maths thing but im not clever :/

any help would be great,
Sam

Nicolas Chaverou

unread,
Dec 7, 2016, 4:55:14 AM12/7/16
to python_in...@googlegroups.com
Need to go the other way: vector from a to b is (b-a)  {-3, 2, 4}

Best,

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/6eb23b46-3002-4d76-8a26-9d9e4998b71a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

f.michal

unread,
Dec 7, 2016, 4:57:51 AM12/7/16
to python_in...@googlegroups.com
W dniu 2016-12-07 o 09:58, alessia...@gmail.com pisze:
You want to find vector "dist", so that:

a + dist = b

then, subtracting 'a' from both sides of equation:

dist = b - a


verify:

a + dist = b ==> a + (b-a) = b ==> b=b

:)

s...@weacceptyou.com

unread,
Dec 7, 2016, 5:52:49 AM12/7/16
to Python Programming for Autodesk Maya
cool thanks guys, was confusing me
Reply all
Reply to author
Forward
0 new messages