affine

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: 1 Imported by: 2

Documentation

Overview

Package affine allows for combinations of points where the sum of the coefficients is zero.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Center

type Center []d3.Pt

Center represents the center of a set of points, all equally weighted

func (Center) Centroid

func (c Center) Centroid() d3.Pt

Centroid returns the average point.

type Weighted

type Weighted struct {
	Pts     []d3.Pt
	Weights []float64
	Sum     float64
}

Weighted allows for each point to be individually weighted before taking the sum.

func (*Weighted) Add

func (af *Weighted) Add(pts ...d3.Pt)

Add many points, all with a weight of 1

func (*Weighted) Get

func (af *Weighted) Get() d3.Pt

Get the current weighted sum.

func (*Weighted) Weight

func (af *Weighted) Weight(pt d3.Pt, w float64)

Weight an individual point

Jump to

Keyboard shortcuts

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