Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Geometry question

Author
Message
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Sep 2016 18:20 Edited at: 12th Sep 2016 18:34
Suppose the pivot point of a rectangle is stationary, say at [0,0]. The dimensions of the rectangle are known. The dotted line represents a boundary at the edge of the rectangle. My illustration may not show it, but the point opposite of the pivot corner will cross over that boundary when the rectangle is rotated. I believe at 45 degrees is when that point would reach out the farthest. By how much depends on the Y variable of said rectangle. (The boundary is always equal to X so the edges meet when it's aligned along the axis). I need to figure out how far beyond that boundary line point A goes when it rotates.


"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 13th Sep 2016 07:24 Edited at: 13th Sep 2016 07:29
First find the length (hypotenuse) from the pivot point (origin) to the adjacent point.

length = sqrt(X'^2.0+Y'^2.0)

Now find the angle to the adjacent point, which will be negative.

ang = -acos(X'/length)

To find the X distance after rotation find the cosine of the angle plus the rotation angle and multiply by the length.

distance = cos(ang+rotang)*length
Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 13th Sep 2016 08:54 Edited at: 13th Sep 2016 08:56
Quote: "I need to figure out how far beyond that boundary line point A goes when it rotates."
The post above mine is good; I'll give my own simple crack at it too though. Just calculate the lenght of a line (or the distance) between the pivot point and point A, then draw a line, of that length, straight down from the pivot point. That should be the absolute lowest point A can possibly go below the dotted line.

Another way to look at it (which I am sure you're aware of) is knowing that, as the shape rotates around a specific pivot point, any given point on that shape will just follow a circular path. Hence finding the distance between a given point and the pivot point gives the radius of the circle, center being the pivot point. Then it's easy to visualize how to calculate where things will and won't go.

GI think that's what you were asking. But maybe I'm too tired right now and just took out my contacts so the digital colorful light grid is all fuzzy.
OUT with the ugly campaign signature and IN with some super fancy text.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 13th Sep 2016 10:30
Quote: "digital colorful light grid"
- Very "Tron"
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Sep 2016 13:38
Simple enough, I just couldn't put it together the other night.

One thing though about calculating the angle. I'm assuming it's the angle near the pivot point where the hypotenuse starts? Or are you calculating the angle in the corner that's actually moving over the boundary?

Either way, both your answers helped my brain finally click. Wicked got my brain hamster running again, and Dark Java helped me see a simplified solution. Since I only need to know the maximum distance that point can stick out on a specific axis, I don't really need all these angles. I think I was over-complicating things.

h = sqrt(x^2 + y^2)
c = h - boundary.x

'c' tells me how much beyond the boundary I can possibly reach. The whole thing for this is to determine the amount of space, or clearance, I need between the edge of a rotating bookshelf and an adjacent wall. Think secret hidden door

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 14th Sep 2016 15:03
Quote: "One thing though about calculating the angle. I'm assuming it's the angle near the pivot point where the hypotenuse starts? Or are you calculating the angle in the corner that's actually moving over the boundary?"


Actually both, it's the angle the end points of the hypotenuse make with the X dimension it contacts.

Login to post a reply

Server time is: 2024-03-29 09:43:44
Your offset time is: 2024-03-29 09:43:44