LEFT | RIGHT |
(no file at all) | |
| 1 // Copyright 2014 The Go Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style |
| 3 // license that can be found in the LICENSE file. |
| 4 |
| 5 // Package f32 implements some linear algebra and GL helpers for float32s. |
| 6 // |
| 7 // WARNING |
| 8 // |
| 9 // The interface to this package is not stable. It will change considerably. |
| 10 // Only use functions that provide package documentation. Semantics are |
| 11 // non-obvious. Be prepared for the package name to change. |
| 12 // |
| 13 // Oh, and it's slow. Sorry. |
| 14 package f32 |
| 15 |
| 16 import "math" |
| 17 |
| 18 type Radian float32 |
| 19 |
| 20 func Cos(x float32) float32 { |
| 21 return float32(math.Cos(float64(x))) |
| 22 } |
| 23 |
| 24 func Sin(x float32) float32 { |
| 25 return float32(math.Sin(float64(x))) |
| 26 } |
| 27 |
| 28 func Sqrt(x float32) float32 { |
| 29 return float32(math.Sqrt(float64(x))) // TODO(crawshaw): implement |
| 30 } |
| 31 |
| 32 func Tan(x float32) float32 { |
| 33 return float32(math.Tan(float64(x))) // TODO(crawshaw): fast version |
| 34 } |
LEFT | RIGHT |