angle

package
v0.0.0-...-548dba9 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2018 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyPeriod = Period{0, 0, false}
View Source
var FullPeriod = Period{0, 0, true}

Functions

func Norm

func Norm(angle float64) float64

put angle in degs in [0;360) range

func NormRange

func NormRange(ang1, ang2 float64) (float64, float64)

normalize start angle in [0;360) and end in [start; start+360] so always end >= start. End value itself may be more than 360

Types

type Period

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

start and end angle of period, both are supposed to be [0;360) [a,a) is an empty, if not isFull isFull is 360 degree full circle

func NewPeriod

func NewPeriod(start, end float64) Period

func (Period) Contains

func (a Period) Contains(b Period) bool

func (Period) Empty

func (a Period) Empty() bool

func (Period) End

func (a Period) End() float64

func (Period) Get

func (a Period) Get() (start, end float64)

func (Period) Has

func (a Period) Has(dir float64) bool

is dir within Period [start;end) Full contains any direction Empty has nothing Dir MUST be NORMED

func (Period) HasIn

func (a Period) HasIn(dir float64) bool

HasIn is Has without a.start point, so for period it is (start;end) Rays have nothing within Dir MUST be NORMED

func (Period) Intersect

func (a Period) Intersect(b Period) (n int, periods [2]Period)

Intersect returns number of intersection (0-2) and their values Rays may intersect equal Ray or period containing ray's direction, result is ray Periods touching one start-end point do not intersect in it, so intersect results on non-ray periods can't be a ray

func (Period) IsFull

func (a Period) IsFull() bool

func (Period) IsIntersect

func (a Period) IsIntersect(b Period) bool

func (Period) MedPart

func (a Period) MedPart(alpha float64) float64

func (Period) Medium

func (a Period) Medium() float64

func (Period) Split

func (a Period) Split(b Period) (n int, periods [3]Period)

func (Period) Start

func (a Period) Start() float64

func (Period) Sub

func (a Period) Sub(b Period) (n int, periods [2]Period)

Sub subtracts b from a period, returning number of, and parts Ray subtracted from equal ray deletes it. Ray subtracted from period is no-op.

func (Period) Wide

func (a Period) Wide() float64

Jump to

Keyboard shortcuts

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