line

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package line implements a 1D line in N-dimensional ambient space.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type L

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

L defines a parametric line of the form

L := P + tD

func New

func New(p vector.V, d vector.V) *L

func (L) D

func (l L) D() vector.V

func (L) L

func (l L) L(t float64) vector.V

L calculates the vector value on the line which corresponds to the input parametric t-value.

func (L) P

func (l L) P() vector.V

func (L) Parallel added in v0.5.0

func (l L) Parallel(m L) bool

Parallel checks if two lines are parallel. A return value of false may indicate the lines intersect, are skew lines, or are anti-parallel.

We check for the parallel property by examining the ratio of the vector directions.

See https://stackoverflow.com/a/45181059/873865 for more details.

func (L) T

func (l L) T(v vector.V) float64

T calculates the projected t-value of v onto l by finding the point on L closest to v.

Jump to

Keyboard shortcuts

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