XVisuals/functions.go

20 lines
336 B
Go
Raw Permalink Normal View History

2024-10-22 18:34:39 +00:00
package main
import (
"math"
)
type X1 struct{}
func (x *X1) Func(f float64) uint16 {
v := (65535 / 2) * (float64(screenHeight+screenWidth) / 2) / f
return ToUint16(v)
}
type X2 struct{}
func (x *X2) Func(f float64) uint16 {
v := (math.Sin((float64(screenWidth)*float64(screenHeight))/f) + 1) / 2 * 65535
return ToUint16(v)
}