Skip to content

Add Plane.Project - #137015

Open
Manish-1kumar wants to merge 1 commit into
dotnet:mainfrom
Manish-1kumar:users/Manish-1kumar/plane-project
Open

Manish-1kumar wants to merge 1 commit into
dotnet:mainfrom
Manish-1kumar:users/Manish-1kumar/plane-project

Conversation

@Manish-1kumar

Copy link
Copy Markdown
Contributor

Implements the API approved in #107407:

public static Vector3 Project(Plane plane, Vector3 point);

It returns the point on plane closest to point, computed as approved: point - (Dot(plane.Normal, point) + plane.D) * plane.Normal. The implementation reuses the existing vectorized DotCoordinate, which computes Dot(Normal, point) + D.

Like Plane.Transform, the method expects a normalized plane, and this is documented in the remarks.

Testing

  • The example from the proposal, points on both sides of the plane, and a point already on the plane.
  • Arbitrary normalized planes: the result lies on the plane, matches the reference formula, is offset from the original point along the normal, and projecting again doesn't move it.
  • The test assertions were also run against .NET 10's Plane (the largest rounding error was 2.4e-7, well within the 1e-5 tolerance). CoreLib, the ref (including API compat) and the tests build cleanly.

Fixes #107407

🤖 Generated with Claude Code

Add the Plane.Project(Plane, Vector3) API approved in dotnet#107407, which
projects a point onto a normalized plane.

Fixes dotnet#107407

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 5, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Numerics community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Plane.Project

1 participant