bit101 on Nostr: A function I made this year that I wish I made decades ago // WrapTau wraps a number ...
A function I made this year that I wish I made decades ago
// WrapTau wraps a number to be within 0 (inclusive) to 2 * Pi (exclusive).
func WrapTau(value float64) float64 {
return math.Mod(math.Mod(value, Tau)+Tau, Tau)
}
Published at
2023-11-11 14:43:41Event JSON
{
"id": "b6fb8648cfc998689d7ae30291694e4a9adb98e5f8bd82e2c72e1e8960e5dcc8",
"pubkey": "bcc04db54e0b9b343356d7c018131cbd84c5ccb9dee30081a4f7f9bb9cc9e536",
"created_at": 1699713821,
"kind": 1,
"tags": [
[
"proxy",
"https://mstdn.social/users/bit101/statuses/111392445034688838",
"activitypub"
]
],
"content": "A function I made this year that I wish I made decades ago\n\n // WrapTau wraps a number to be within 0 (inclusive) to 2 * Pi (exclusive).\nfunc WrapTau(value float64) float64 {\n\treturn math.Mod(math.Mod(value, Tau)+Tau, Tau)\n}",
"sig": "c150e6664de4dd615e1c22a4684a94c69f9b78082f629862be08957a30675b1e8689acee49499543a67f91a9594c64b4d54a61d16acde00bd8149af5a0befc77"
}