geometry

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateRotationAngle added in v0.1.3

func CalculateRotationAngle(pA, pB, qA, qB Point) float64

已知两点在两平面坐标系中的坐标,求坐标系夹角,A旋转到B的度数,逆时针>0 CalculateRotationAngle

func IsPointInRectangle added in v0.1.9

func IsPointInRectangle(p Point, rCenter Point, w, h, angleDeg float64) bool

图片就是第四象限,角度90+θ

func NormalizeAngleDegrees added in v0.1.9

func NormalizeAngleDegrees(theta float64) float64

func RectangleCorners added in v0.1.12

func RectangleCorners(rCenter Point, w, h, angleDeg float64) [][]float64

Types

type Point

type Point struct {
	X float64
	Y float64
}

Point 结构体用于表示一个点

func RandomPoint added in v0.1.9

func RandomPoint(min, max Point) Point

func RotatePoint added in v0.1.9

func RotatePoint(p Point, center Point, angleDeg float64) Point

RotatePoint 计算点 (x, y) 绕点 (centerX, centerY) 旋转 angle 度后的新坐标

func TransformPointByOnePointAndRotationAngle added in v0.1.3

func TransformPointByOnePointAndRotationAngle(pA, qA, qB Point, angleDeg float64) (pB Point)

TransformPointByOnePointAndRotationAngle transforms a point from coordinate system a2 to a1 在数学和计算机图形学中,旋转角度的正负通常遵循右手定则。默认情况下,顺时针方向被认为是负的,而逆时针方向被认为是正的。 O2相对于O1旋转度数

func (*Point) Rotate added in v0.1.9

func (p *Point) Rotate(angleDeg float64)

type Rectangle

type Rectangle struct {
	DiagonalVertice1, DiagonalVertice2 Point
}

type Triangle added in v0.1.6

type Triangle struct {
	A, B, C Point
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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