Jump to content
Sign in to follow this  
swambast

Wanted: Math/Geometery Gurus

Recommended Posts

Alright guys, I'm sorry I've just never been good with math/geometry and my regular knowledgeable resource experts are unavailable right now, so I'm turning to the community for help with some calculations/formulas. I'm trying to determine a formula (based off Pythagorean's Theorem) for calculating displaced center-point object offsets.

 

For example:

Inputs:

X Offset and Y Offset Coordinates (example: 0,0)

X Offset and Y Offset Distance (example: 38,0) means target center actually sits 38M to the East/Right wherever placed, and therefore has a displaced center-point offset of x=38

Target Width (example: 10)

Target Height (example: 25)

 

Output Returns:

X1/Y1 = 33.00,12.50

X2/Y2 = 43.00,12.50

X3/Y3 = 43.00,-12.50

X4/Y4 = 33.00,-12.50

 

This is an easy example! Where things get complicated is when the target object has BOTH an X and Y Offset Value. If anyone has strong mathematical and geometry skills and would be willing to help, please send me a Private Message. Thanks for reading.

 

Thanks much,

Swambast

Share this post


Link to post
Share on other sites

What do you need help with matey?

Share this post


Link to post
Share on other sites

Hi ya, need help figuring out what the end values would be a target offset by both the x/y axis so it properly calcs X1/Y1, X2/Y2, X3/Y3 and X4/Y4. And, I believe the first known variable you would have to determine is what the offset value would be using a point of reference (say placing an object in a 0,0 centerpoint using a 50x50 meter dimension)...

Share this post


Link to post
Share on other sites

Using your definitions,

 

x_0,y_0 = offset coordinates

x_off,y_off = offset distance

w = target width

h = target heigth

 

then

 

X1/Y1 = (x_0+x_off-.5*w),(y_0+y_off+.5*h)

X2/Y2 = (x_0+x_off+.5*w),(y_0+y_off+.5*h)

X3/Y3 = (x_0+x_off+.5*w),(y_0+y_off-.5*h)

X4/Y4 = (x_0+x_off-.5*w),(y_0+y_off-.5*h)

 

Filling in your example,

 

x_0,y_0 = 0,0

x_off,y_off = 38,0

w = 10

h = 25

 

then

 

X1/Y1 = (0+38-.5*10),(0+0+.5*25)=33,12.5

X2/Y2 = (0+38+.5*10),(0+0+.5*25)=43,12.5

X3/Y3 = (0+38+.5*10),(0+0-.5*25)=43,-12.5

X4/Y4 = (0+38-.5*10),(0+0-.5*25)=33,-12.5

 

Now including an y offset distance,

 

x_0,y_0 = 0,0

x_off,y_off = 38,45

w = 10

h = 25

 

then

 

X1/Y1 = (0+38-.5*10),(0+45+.5*25)=33,57.5

X2/Y2 = (0+38+.5*10),(0+45+.5*25)=43,57.5

X3/Y3 = (0+38+.5*10),(0+45-.5*25)=43,-32.5

X4/Y4 = (0+38-.5*10),(0+45-.5*25)=33,-32.5

 

Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use, Privacy Policy, and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..