Skip to content

[API Proposal]: Plane.Project #107407

@PavielKraskouski

Description

@PavielKraskouski

Background and motivation

Projecting a point onto a plane is a basic operation that can be used in a variety of problems.

API Proposal

namespace System.Numerics;

public struct Plane
{
    public static Vector3 Project(Plane plane, Vector3 point)
    {
        return point - (Vector3.Dot(plane.Normal, point) + plane.D) * plane.Normal;
    }
}

API Usage

Vector3 point = new(1, 2, 3);
Plane plane = new(Vector3.UnitY, -5);
Vector3 projectedPoint = Plane.Project(plane, point);

Alternative Designs

No response

Risks

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestionEarly API idea and discussion, it is NOT ready for implementationarea-System.Numericsneeds-further-triageIssue has been initially triaged, but needs deeper consideration or reconsideration

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions