pointrange

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package pointrange holds distributions that accept and return 3d points

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constant

type Constant floatgeom.Point3

Constant implements Range as a poll which always returns the same floatgeom.Point3eger.

func (Constant) EnforceRange

func (c Constant) EnforceRange(floatgeom.Point3) floatgeom.Point3

EnforceRange on a constant must return the constant

func (Constant) InRange

func (c Constant) InRange(i floatgeom.Point3) bool

InRange is only valid for a constant if c == i

func (Constant) Poll

func (c Constant) Poll() floatgeom.Point3

Poll returns c cast to an floatgeom.Point3

type Range

type Range interface {
	Poll() floatgeom.Point3
	// Mult(float64, float64, float64) Range
	InRange(floatgeom.Point3) bool
	EnforceRange(floatgeom.Point3) floatgeom.Point3
}

Range represents the ability to poll a struct and return an integer, distributed over some range dependant on the implementing struct.

func NewConstant

func NewConstant(i floatgeom.Point3) Range

NewConstant returns a range which will always return the input constant

func NewLinear

func NewLinear(min, max floatgeom.Point3) Range

NewLinear returns a linear range between min and max

func NewSpread

func NewSpread(base, s floatgeom.Point3) Range

NewSpread returns a linear range from base - s to base + s

Jump to

Keyboard shortcuts

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