tentsuyutils

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AngleBetween

func AngleBetween(x1, y1, x2, y2 float64) float64

AngleBetween returns the float64 angle of the given 2 sets of x,y coords

func DegreeToRadian

func DegreeToRadian(degree float64) float64

DegreeToRadian takes a given degree and returns the radian value

func Distance

func Distance(x1, y1, x2, y2 float64) float64

Distance returns the scalar distance between two points

func MakeRangeInt

func MakeRangeInt(min, max int) []int

MakeRangeInt of ints between min and max values

func NearCoords

func NearCoords(x, y, x1, y1, radius float64) bool

NearCoords tests if (x,y) are "near" (x1, y1) based on radius

func PercentDifference

func PercentDifference(n1, n2 float64) float64

PercentDifference returns the percent difference between n1 and n2 to determine how close they are based on the larger number

func RadianToDegree

func RadianToDegree(radian float64) float64

RadianToDegree takes the radian value and returns the degree value

func RandomBetween

func RandomBetween(min, max int) int

RandomBetween returns a random int between min and max respectively This is just a useful function for many reasons

func RandomBetweenf

func RandomBetweenf(min, max float64) float64

RandomBetweenf is the same as RandomBetween but takes and returns float64 values

func RoundFloat

func RoundFloat(val float64, places int) float64

RoundFloat takes val and returns a float64 with decimal precision of places

func WhatQuadrant

func WhatQuadrant(angle float64) int

WhatQuadrant returns an int representing the quadrant of a circle the angle is in

func WithinDistance

func WithinDistance(x, x1, radius float64) bool

WithinDistance is a simple function to check if x is withing a certain distance of x1

Types

This section is empty.

Jump to

Keyboard shortcuts

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