• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Calculate the differences between one object and another

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh I got the answer and understood it because of your previous answer , Thank you sir !
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic