Jump to content

Recommended Posts

Posted

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

Posted

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)...

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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..