coord

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package coord defines coordinate systems that control how data positions are mapped to the 2D plotting surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coord

type Coord interface {
	// Transform maps normalized (x, y) ∈ [0,1]² to pixel coordinates
	// within the data area of dimensions (width, height).
	Transform(x, y, width, height float64) (px, py float64)

	// String returns a human-readable label.
	String() string
}

Coord transforms scaled data positions (in [0,1] normalized space) into plot-surface positions.

func Cartesian

func Cartesian() Coord

Cartesian returns the default Cartesian coordinate system. x maps to horizontal (left→right), y maps to vertical (bottom→top).

func Polar

func Polar() Coord

Polar returns a polar coordinate system where x maps to angle (theta, 0→2π) and y maps to radius (0→1). Center is at (w/2, h/2).

Jump to

Keyboard shortcuts

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