xa_math

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DegreeRadian

type DegreeRadian struct {
	Degree float64 `json:"degree"` //角度
	Radian float64 `json:"radian"` //弧度
	X0     float64 `json:"x0"`     //圆心坐标x
	Y0     float64 `json:"y0"`     //圆心坐标y
	R      float64 `json:"r"`      //半径
}

func NewDegreeRadian

func NewDegreeRadian(degree, radian, r float64) *DegreeRadian
func main(){
	r := 50.0
	a := 90.0
	dr := NewDegreeRadian(a, 0, r)
	r.Radian = dr.DegreeToRadian()
	fmt.Printf("%f %f\n", dr.X1(), dr.Y1()) // 0.000000 50.000000
}

角度弧度互转

func (*DegreeRadian) DegreeToRadian

func (dr *DegreeRadian) DegreeToRadian() float64

角度转弧度

func (*DegreeRadian) RadianToDegree

func (dr *DegreeRadian) RadianToDegree() float64

弧度转角度

func (*DegreeRadian) X1

func (dr *DegreeRadian) X1() float64

x坐标(left)

func (*DegreeRadian) Y1

func (dr *DegreeRadian) Y1() float64

y坐标(top)

Jump to

Keyboard shortcuts

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