Anyone mathematical?

Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default Anyone mathematical?

    Are you any good at maths? If so I was wondering if you can come up with a nice
    formular that I can program in Lingo that will calculate the angle between two
    vector points. This would be used to rotate a wall that is positioned at one
    vector point (and always pointing upwards from it) so that it rotates to point
    towards a new vector point.

    Two such points could be (0,0,0) to (15,0,20)

    The y cordinate will always be the same within the two vectors.

    I think the answer is in this web page somewhere?

    [url]http://www.netcomuk.co.uk/~jenolive/vect6.html[/url]

    Any thoughts, Thanks.


    JamieCrow Guest

  2. Similar Questions and Discussions

    1. editing mathematical formula
      I like to write and edit mathematical formula some flash texts. I tried to use mathtype: it generates a .gif file, it is not very smart. Has...
    2. Mathematical differences?!
      Hello all, I ported a algorithm from JavaScript to PHP and noticed that PHP outputs a different result than JS. For example: ...
    3. [PHP] Mathematical differences?!
      How could that be?! 1:1 the same code but different outputs? Is this a PHP-bug? :-? *feelin' kinda' smart arsed today, if no one noticed* ...
    4. [PHP] Help with Mod mathematical function
      http://us4.php.net/math The operator you want is % Eg: 5%3 = 2 <desa15@necso.es> wrote in message...
    5. Help with Mod mathematical function
      Hi, I am porting a vb application across to php but have come up against a small problem. The code uses the Mod calculation however I cannot find...
  3. #2

    Default Re: Anyone mathematical?

    Have you seen angleBetween in the 3D Lingo Dictionary?

    Andrew


    Andrew Morton Guest

  4. #3

    Default Re: Anyone mathematical?

    Thanks for that, although it produced odd results. I used pointAt in the end.
    George
    JamieCrow Guest

  5. #4

    Default Re: Anyone mathematical?

    If the two vectors are of unit length, then their dot product is the cosine of
    the angle between them. Thus you can normalize them, then take the arccos of
    their dot product as the angle between them. I think I did this with the code
    below, though I believe I'm not actually using it anymore, so you should check
    for correct output, particularly on boundary cases. Note that (0, 0, 0) is a
    zero-length vector, so there is no angle between it and any other vector. Also
    note that the units here are radians.

    on arccos(z)
    theta = arcsin(z)
    theta = pi / 2.0 - theta
    if z * theta < 0.0 then
    theta = -1 * theta
    end if

    return theta
    end arccos

    on arcsin(z)
    if(z >= 1) then
    return pi / 2.0
    end if
    if(z <= -1) then
    return - pi / 2.0
    end if
    return(atan(z / sqrt(1.0 - (z * z))))
    end arcsin


    veganMalcontent Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139