Get range of 3D object given lowest and highest point and angle

132 Views Asked by At

How do you get 3D range of object (highlighted in red below) given its lowest (PL) and highest (PH) (x,y,z) coordinates and orientation of object? Image below is a top view of a box.

Top view of object

1

There are 1 best solutions below

0
On

I've found a way already

Top view of object

Given:
1)$$H_1 = L\sin(\theta) + W\cos(\theta)$$
2)$$H_2 = L\cos(\theta) + W\sin(\theta)$$

Then...

3)$$L = \frac{H_2 - W\sin\theta} {\cos(\theta)}$$

Substitute... $$H_1 = \frac{H_2-W\sin\theta} {\cos\theta}sin\theta + W\cos\theta$$ $$H_1 = \frac{H_2\sin\theta} {\cos\theta} - \frac{W\sin^2\theta}{\cos\theta} + Wcos\theta$$ $$H_1 = \frac{H_2\sin\theta} {\cos\theta} - \frac{W(1-\cos^2\theta)}{\cos\theta} + W\cos\theta$$ $$H_1 = \frac{H_2\sin\theta} {\cos\theta} - \frac{W}{\cos\theta} + W\cos\theta + W\cos\theta$$ $$H_1 = \frac{H_2\sin\theta} {\cos\theta} - W\left(\frac{1}{\cos\theta} + \cos\theta + \cos\theta\right)$$ $$W\left(\frac{1}{\cos\theta} + \cos\theta + \cos\theta\right) = \frac{H_2\sin\theta} {\cos\theta} - H_1$$ $$W = \frac{(H_2\tan\theta - H_1){\frac{1-2\cos^2\theta}{\cos\theta}}$$ 4)$$W = \frac{(H_2\tan\theta - H_1)\cos\theta}{1-2\cos^2\theta}$$

Since you have W, substitute W of formula 3 to get L.

Once you have L, you can get the points easily.

P.S. This does not apply if angle is 45 degrees.