plane

package
v0.0.0-...-9c88ebf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2022 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plane

type Plane struct {
	Origin  d3.Pt
	X, Y, N d3.V
}

Plane is defined by a point on the plane and a vector perpendicular to plan.

func New

func New(origin, x, ref d3.Pt) Plane

New creates a plane from 3 points. The first point is the origin on the plane, the second indicates the direction that will be treated as the X axis in the plane. The distance between origin and X is normalized. Ref provides a third point that lies in the plane.

func (Plane) Convert

func (p Plane) Convert(pt d2.Pt) d3.Pt

Convert a 2D point in the plane to a 3D point

func (Plane) ConvertMany

func (p Plane) ConvertMany(pts []d2.Pt) []d3.Pt

func (Plane) Project

func (p Plane) Project(pt d3.Pt) (d2.Pt, d3.V)

Project a point onto the plane. Returns the closes point in the plane and a vector from that point to the original 3d point.

func (Plane) String

func (p Plane) String() string

String fulfills Stringer on Plane

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL