• Post Reply Bookmark Topic Watch Topic
  • New Topic

Calculate the differences between one object and another  RSS feed

 
Amit Shef
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

My Question for today is how could i Calculate angles and distances from 1 object as the other one.

By that I mean that if I have Object 1 and Object 2

I want to know what angles and what x and y i need to change so it could be exactly as Object 2.

Currently I don't have any code to show because there isn't.

Thanks in Advance.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you don't have any code, then that's good. That means you can work out how to do it on paper first. Once you know how to do it yourself, THEN you can write the code.

Having said that, your question doesn't make much sense. Do you mean you have x and y coordinates of each object? Are you trying to find some angle (and measured against what exactly) between them?

This sounds like basic algebra or trig type stuff. Nothing terribly complicated.
 
Amit Shef
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First , really thanks for relpying , I mean that i want to know what angle i need to move object 1 to make it as object 2
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you drawn it out on paper, and worked through the math by hand? if object A is at (2,3), and object B is at (3,4), what would be the angle?
 
Amit Shef
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh I got the answer and understood it because of your previous answer , Thank you sir !
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!