Announcement

Collapse
No announcement yet.

Is there a mathmatician in the house?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is there a mathmatician in the house?

    I just can't figure it out:
    How on earth does one calculate the base point of a normal (N) from a point (P) to a line (AB) in 3d space?
    ]V[]V[

  • #2
    Ask Ordinator, he made a nice tutorial on UEd to real scale.
    JM

    Comment


    • #3
      Adjust your coordinate axes so that P and AB are co-planar, and solve as for 2D?

      Comment


      • #4
        I sez: http://www.netcomuk.co.uk/~jenolive/vect8.html

        Dalai sez: http://physics.syr.edu/courses/java-suite/crosspro.html
        AI Programmer,
        Thievery UT

        Comment


        • #5
          Been a while, but I believe it goes like this:

          Consider points A,B,P,Q.

          Points A and B form vector AB (ie vec(AB)).

          Point P is a known point in space. It also forms (with point A) vec(AP).

          Point Q exist on line AB and line PQ is perpendicular to to line AB

          1) Find the dot product [(vec(AP))*(vec(AB))]. Result is a scalar.

          2) Find the distance of point Q from point A by dividing the magnitude of vec(AB) by the dot product just obtained. (ie { (vec(AP))*(vec(AB)) } / { |vec(AB)| } ).

          Hope that helps.

          <Edited because I made a mistake>
          Give some taffer fire, and you'll keep him warm for the night with one less reason to cause trouble for the master.
          Set a taffer on fire, and he will be warm for the rest of his life, and have no need to bother the master.

          Comment


          • #6
            Not sure how the cross-product references above are to be applied (unless I misunderstood the intial question). Apply the definitions from my first comment and add plane(ABP) as the plane defined by points A,B and P. { Vec(AB) X vec(AP) } results in a vector perpendicular to plane(ABP) that intersects plane(ABP) at point A. Not sure how that helps find point Q on line(AB) such that line(PQ) is perpendicular to line(AB). If it does, please elaborate as I am curious. Thanks.
            Give some taffer fire, and you'll keep him warm for the night with one less reason to cause trouble for the master.
            Set a taffer on fire, and he will be warm for the rest of his life, and have no need to bother the master.

            Comment


            • #7
              Hmm.. maybe I misunderstood the question - I thought he was looking for the normal of the plane created by the 3 points.
              AI Programmer,
              Thievery UT

              Comment


              • #8
                Thanks everyone.

                If I know the distance from A to Q, it's really easy:

                Q = A + Normal( B - A ) * distance

                So the whole formula in UScript would be:

                Q = A + Normal( B - A ) * ((( B - A ) dot ( P - A )) / VSize( A - B ));

                Would that be correct?
                ]V[]V[

                Comment


                • #9
                  w00t!
                  Thanks Thebos, it's working perfectly!
                  Methinks me might have to script you a funny mutator with this...
                  ]V[]V[

                  Comment


                  • #10
                    I flew a plane in 3D space once.

                    Normal? what? ohh... me? hell no.

                    Comment

                    Working...
                    X