23rd May 2006

signed angle between two vectors(3d) in c/c++

posted in reviews |

I tried to realize some point-in-polygon-test in 3D for my raytracer and came upon the problem to calculate a signed angle between 2 vectors. Trying to find this in the web was not easy, somehow most people project the polygon plane and the point into 2d and do the test there. But here is the method i found:

signed_angle = atan2(  N * ( V1 x V2 ), V1 * V2  );
// where * is dot product and x is cross product
// N is the normal to the polygon
// ALL vectors: N, V1, V2 must be normalized

It worked for me.

This entry was posted on Tuesday, May 23rd, 2006 at 11:58 pm and is filed under reviews. You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.

There are currently 3 responses to “signed angle between two vectors(3d) in c/c++”

Why not let us know what you think by adding your own comment! Your opinion is as valid as anyone elses, so come on... let us know what you think.

  1. 1 On May 8th, 2020, search scrapers said:

    search scrapers

    blog topic

  2. 2 On May 12th, 2020, search engine scrape said:

    search engine scrape

    blog topic

  3. 3 On May 13th, 2020, Google Search trends said:

    Google Search trends

    blog topic