A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Quick problem

  1. #1
    general rule bender Gloomycus's Avatar
    Join Date
    Nov 2000
    Location
    ontario canada
    Posts
    1,538
    I'm bored, so I thought I would post a problem for you people to solve.

    Find a unit vector that is perpendicular to both vectors a' = (-3,-1,5) and b' = (1,4,-3) and that makes an obtuse angle with the positive z-axis.

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    //a' = (-3,-1,5) and b' = (1,4,-3)
    x1 = -3;
    y1 = -1;
    z1 = 5;
    x2 = 1;
    y2 = 4;
    z2 = -3;
    z = 1;
    x = (z1*y2-z2*y1)/(x2*y1-x1*y2);
    y = (z2*x1-z1*x2)/(x2*y1-x1*y2);
    distance = Math.sqrt(x*x+y*y+z*z);
    x /= distance;
    y /= distance;
    z /= distance;
    trace(x);
    //0.823652691289566
    trace(y);
    //0.193800633244604
    trace(z);
    //0.53295174142266


    Am I right ?

  3. #3
    Junior Member
    Join Date
    Jul 2002
    Posts
    25
    How about this?

    Code:
    a = <-3, -1, 5>
    b = <1, 4, -3>
    
    // Cross Product
    a X b = -17i - 4j - 11k
    
    // Magnitude of Cross Product
    ||a X b|| = sqrt(426)
    
    // Unit vector
     a X b
    ----------
    ||a X b||
    
          17            4           11
    = - ---------i - --------j - --------k
        sqrt(426)    sqrt(426)   sqrt(426)
    This vector makes an obtuse angle from the positive z-axis since it's z-component is negative (Is that sound reasoning?) Am I right?

  4. #4
    Member
    Join Date
    Apr 2002
    Posts
    76

    Deleted.

    Deleted.
    Last edited by mike_flashmx; 10-18-2010 at 12:15 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center