Dot vs cross

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

  • Dot vs cross



    I just write this thread because there still have questions about dot and cross products here, and I remeber that I wrote some other threads about them (links at the end).

    Some reminders about differences between cross product and dot product.

    The first one is important, the cross product creates a vector, the dot product creates a number !

    Graphically, the dot can be represented like this :
    dot.JPG
    The same way for the cross :
    cross.JPG

    The problem about the cross product with PC-DMIS, is that the result is always a unit vector (the result is divided by its own length).
    So you can't use it directly to calculate angles or distances.

    A little more about it on those threads, old or not, giving explanations or examples...
    https://www.pcdmisforum.com/forum/pc...xamples-of-use
    https://www.pcdmisforum.com/forum/pc...sing-variables
    https://www.pcdmisforum.com/forum/pc...of-dot-product
    https://www.pcdmisforum.com/forum/pc...-about-vectors
    https://www.pcdmisforum.com/forum/pc...on-from-points
    https://www.pcdmisforum.com/forum/pc...point-to-plane
    Attached Files

  • #2
    Thanks for sharing the knowledge.

    B&S CHAMELEON/PCDMIS CAD++ V2011

    There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

    sigpic

    Comment


    • JEFMAN
      JEFMAN commented
      Editing a comment
      Thx, dph51 !
      This thread is not very new, but it allows finding some answers to those who use "search button" !

  • #3
    Great stuff!
    PcDmis 2015.1 SP10 CAD++
    Global 7-10-7 DC800S

    Comment


    • #4
      I just ran into the cross product returning the unit vector after beating my head against the wall for an hour trying to figure out why my point-to-line code wasn't working. Ugh... It would be helpful if that defect was at least stated in the documentation.

      Comment


      • #5
        There's a very old thread (or maybe it was a phone answer) in which I asked the question, the answer was "there's a cross_only function inside the soft, but it's not accessible to users", or something like this.
        In the thread above, "cross_only" function should be "P_Vect" ("produit vectoriel" in french )

        Code:
        ASSIGN/V1=F5.XYZ-F4.XYZ
        ASSIGN/V2=F6.XYZ-F4.XYZ
        ASSIGN/P_VECT=CROSS(V1,V2)*SQRT(DOT(V1,V1))*SQRT(DOT(V2,V 2))*SIN(DEG2RAD(ANGLEBETWEEN(V1,V2)))
        https://www.pcdmisforum.com/forum/pc...xamples-of-use

        Comment


        • mbatten
          mbatten commented
          Editing a comment
          Thank you! That should help. Do you know if computing it from the angle is better than using the XYZ coordinates? It's dumb we have to do this...

          Interestingly, if you type out CROSS_ONLY in an expression, PC-DMIS takes it, but it returns zero. Weird...

        • mbatten
          mbatten commented
          Editing a comment
          Also, do you know if this has been submitted as a bug?

      • #6
        mbatten : I'm sorry, I'm not sure to understand the first question... If you want an accurate result, you have to use the max decimal places.
        If you calculate a lonfg vector with only 3 decimal places, I'm not sure that the result is good (I will check it, asap )
        For the second, I remember now, it has been "reported" long time before I registered on the forum. As usual, the answer was : " it works as it's concepted"...

        Comment


        • mbatten
          mbatten commented
          Editing a comment
          There's a somewhat messy formula to compute the cross product using the X, Y, and Z coordinates of each vector. I was just wondering if it would give a more accurate result in some situations.

      • #7
        mbatten : here at #25 ?
        I think it's the same, except if you don't use decimal places enough...

        Comment


        • mbatten
          mbatten commented
          Editing a comment
          OK, thanks. And thank you for starting this thread last year - I wish I would have found it sooner!

      • #8
        More proof that Jeff is a CMM robot from outer space

        Comment


        • JEFMAN
          JEFMAN commented
          Editing a comment
          CMM robot, so far from my cmm, for too many weeks ...

        • DAN_M
          DAN_M commented
          Editing a comment
          =(

          Sorry Jeff. Hope you can get back to work soon

        • JEFMAN
          JEFMAN commented
          Editing a comment
          Don't be sorry, it's not so bad...
          I've my offline dongle, and some excel sheets to play with... like a robot !

      Related Topics

      Collapse

      Working...
      X