Skip to content

Add basic geometric math functions #2

@akashkgarg

Description

@akashkgarg

Provide the following functions:

// compute angle between (a - b) and (c - b)

angle(vec a, vec b, vec c)

// compute angle between vectors v1 and v2

angle(vec v1, vec v2);

// returns true if the given point is inside triangle (a,b,c).

// Also returns barycentric coordinate of the point in the triangle.

pointInTriangle(vec2d a, vec2d b, vec2d c, vec2d pt, vec3d bary);

// Projects a 3d point into a triangle and returns true/false if the point lies in the triangle.

// Also returns barycentric coordinates of the projected point.

projectInTriangle(vec2d a, vec2d b, vec2d c, vec2d pt, vec3d bary);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions