hyperplane

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package hyperplane defines an (N - 1)-dimensional geometric hyperplane which is embedded in the N-dimensional ambient space.

In 2D ambient space, the hyperplane is a 1D linear constraint of two variables (i.e. a line that lies on the XY-plane).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Disjoint

func Disjoint(a HP, b HP) bool

Disjoint returns if the region of interection between two planes is empty.

Disjoint checks if the characteristic lines of the two planes are parallel, and if the a line drawn between two points on the planes, away from the first plane, lie in the feasible region of the first plane.

func Within

func Within(a HP, b HP) bool

Types

type HP

type HP struct {
	// contains filtered or unexported fields
}

HP defines an (N - 1)-dimensional hyperplane geometrically consisting of an N-dimensional normal vector n to the plane, and an N-dimensional offset p which relates the hyperplane to the ambient space origen.

N.B.: By arbitrary convention, vectors pointing away from N are not permissible within the half-plane.

func New

func New(p vector.V, n vector.V) *HP

New constructs a half-plane passing through a point P and with normal N.

func (HP) In

func (hp HP) In(p vector.V) bool

In checks if a given point in vector space is in valid region of the half-plane.

func (HP) N

func (hp HP) N() vector.V

N returns the normal vector of the plane, pointing away from the invalid region.

func (HP) P

func (hp HP) P() vector.V

Jump to

Keyboard shortcuts

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