geom

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 1 Imported by: 6

Documentation

Overview

Package geom contains structs for representing a Point and a Triangle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X int
	Y int
}

Point represents a 2D point with integer coordinates.

type Triangle

type Triangle struct {
	Points [3]Point
}

Triangle represents a triangle with integer coordinates.

func NewTriangle

func NewTriangle(x0, y0, x1, y1, x2, y2 int) Triangle

NewTriangle returns a new Triangle with specified vertex coordinates.

func (Triangle) ToNorm

func (t Triangle) ToNorm(w, h int) normgeom.NormTriangle

ToNorm returns the normalized equivalent of a Triangle given a width and height.

Jump to

Keyboard shortcuts

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