Jump to content

A math question


tipforeveryone
 Share

Recommended Posts

Spiderpig is asking about the clarification of angle alpha in relation to what plane it is on. Is that angle value based on an orthographic view (looking down from top) or is the angle along the plane that would exist if the 3 points were on different vertical points in 3D space. Assuming that we are looking at the triangle above in the XZ plane and the Y axis is going into the screen. If its the latter, i don't think we have enough information about what determines the orientation of the plane between the 3 points.

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Take a look at the picture to see the problem.

Think of the line between Red and Blue as a rotating shaft. Think of the green line of known length at known angle as a fixed limb coming off Blue. As the Red/Blue shaft rotates, the Black dot could be anywhere along the red circular path and still hold true to the information that has been provided. 

problem2.png.050c2a1911c9d240baff1a112140457a.png

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

Quote

It sound sweet, then please help me with a simple fomula or steps to archive my calculation

I don't know how simple it will be but I will try tomorrow after work if someone does not help you before then. I needed to go to bed two hours ago. 

  • Thanks 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

In the following I will use the following terminology:

A -> blue point, B -> red point, C -> yellow point, D -> black point (point to find); I will further use o to specify the dot-product of two vectors and use v1, v2, v3 to specify the individual components of v.

Overview:

You need to mirror B on the line AC. This will yield a point B' which is on the line AD. From there you can calculate D by going |u| from A in the direction of AB'.

Step by step:

The line going through A and C can be written as X=A+p*a with p being a scalar variable.

We need to find a vector Z such that B+Z is on that line (i.e. there exists a value for p such that B+Z = A+p*a -> Z = A+p*a-B -> Z = p*a-w) and that is perpendicular to a (i.e. Z o a = 0). Together that is:

0 = (p*a-w) o v

0 = (p*a1-w1)*a1 + (p*a2-w2)*a2 + (p*a3-w3)*a3

-> p = (a1*w1+a2*w2+a3*w3)/(a1*a1+a2*a2+a3*a3)

-> p = (a o w) / |a|

With this we can calculate Z as Z = p*a-w

Now we can mirror B as B' = B+2*Z

-> B' = B+2*(p*a-w)

Now we can calculate D as D = A + |u| * (B' - A) / |(B' - A)|

Implementation:

Simply hack in the formulas I marked as fat and you should be good (p is a float and B' and D are both vectors). Let me know if you need any further help with that!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Ma-Shell obviously knows his vector math but like the OP, vector math has always been a struggle for me though I can handle 3D geometry fair enough . I have to break vector math down into steps that I can understand and follow, So even though you have an answer already (but past my ability to follow), I decided to take a crack at this. I used multiple references and I will post them with the steps as this was a fun learning experience for me.

So the problem was to find pointD given this information:

given.jpg.a40441537f1a5f5244aa33351cfb9c7f.jpg 

Given: 

  • 3 points given are all on the same plane, points A, B, & C 
  • The angle between VectorA-B and VectorA-C is equal to angle between  VectorA-B and VectorA-D
  • The distance from point A to point D is known

Find: point D 

Assumptions:

  • The three given points are not collinear to allow for determining the plane equation
  • Due to equal angles between vectors, VectorA-MirroredPoint is the reflected vector of VectorA-C across the mirror plane that is along VectorA-B

 

Solution:

To reflect a point across the mirror plane, we must first find the plane that the three given points (A,B, and C) are located. Once we have planeABC, then the mirror plane will be orthogonal to that plane and pass through the line or vector AB. Once the mirror plane is determined, then we can mirror the point. And finally determine the point along the line where the fixed length would occur.

1) Find the plane that contains points A, B, and C. Using the 3 points, you can calculate two vectors:

    1a) Find the two vectors given the 3 points - A, B, & C. --Finding a 3D line through 2 points --https://www.youtube.com/watch?v=JlRagTNGBF0
          Vab = FindVector( pointA, pointB ) --vector AB
          Vac = FindVector( pointA, pointC ) --vector AC

    1b) Get the normal vector to two vectors. --Equation of a Plane Passing Through 3 Points --https://www.youtube.com/watch?v=0qYJfKG-3l8                           

          normalvector = FindNormalOfTwoVectors( Vab, Vac )

    1c) Get the Plane Equation using the normal vector and a point --Note that you can use any of the 3 points above and get same answer.

          plane = GetPlaneEquation( normalvector, pointA )

2) To find orthogonal plane for mirror/reflection, we need two vectors and point on the plane -Just like before!
     --Find the Equation of Plane Containing a Line and Orhtogonal to a Given Plane --https://www.youtube.com/watch?v=aupy5wwAyb8
    2a) The normal of planeABC is a vector on the Mirror plane

          Vn = FindNormalVectorOfPlane(plane) 

    2b) We want the mirror/reflection plane to also contain vector AB - which we have already found = Vab. Find the normal vector to the two vectors.

          Mirror_normalvector = FindNormalOfTwoVectors(Vn, Vab)

    2c) Now get the Mirrored Plane's Equation using pointA or pointB and its normal vector

          Mirror_plane = GetPlaneEquation(Mirror_normalvector, pointA)

3) Now that we have the reflection plane that that runs through line AB, lets mirror pointC about it

   --Find Mirror Image of a Point Reflected on Vector Plane
   --https://www.youtube.com/watch?v=fvXG-DVx6z0

     pointMP = FindMirroredPoint(Mirror_plane, pointC)

4) Find pointD that is Dist_AD from pointA

   --Finding a point along a line in 3D given 2 points
   --Used alternative method shown at bottom of page
   --https://math.stackexchange.com/questions/83404/finding-a-point-along-a-line-in-three-dimensions-given-two-points

     pointD = FindPointAlongLine(pointA, pointMP, Dist_AD)

 

Scripts:

 

  • Like 1
  • Thanks 1

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

Link to comment
Share on other sites

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

 Share

×
×
  • Create New...