Skip to content

Instantly share code, notes, and snippets.

@aliekens
aliekens / geodesic_v3_coordinates.cpp
Created December 29, 2021 15:52
All 92 geodesic V3 sphere XYZ coordinates on a unit sphere, in order for a LED string to start at the bottom (0,0,-1) and spiral toward the top (0,0,1)
#define NLEDS 92
double coordinates[ NLEDS ][ 3 ] = { {0,0,-1}}, {-0.241202,-0.175244,-0.815738}}, {-0.241202,0.175244,-0.815738}}, {0.0921311,0.28355,-0.815738}}, {0.298142,0,-0.815738}}, {0.0921311,-0.28355,-0.815738}}, {-0.149071,-0.458794,-0.631476}}, {-0.482405,-0.350487,-0.631476}}, {-0.482405,0,-0.631476}}, {-0.482405,0.350487,-0.631476}}, {-0.149071,0.458794,-0.631476}}, {0.184262,0.567101,-0.631476}}, {0.390273,0.28355,-0.631476}}, {0.596285,0,-0.631476}}, {0.390273,-0.28355,-0.631476}}, {0.184262,-0.567101,-0.631476}}, {-0.0569401,-0.742344,-0.447214}}, {-0.390273,-0.634038,-0.447214}}, {-0.723607,-0.525731,-0.447214}}, {-0.723607,-0.175244,-0.447214}}, {-0.723607,0.175244,-0.447214}}, {-0.723607,0.525731,-0.447214}}, {-0.390273,0.634038,-0.447214}}, {-0.0569401,0.742344,-0.447214}}, {0.276393,0.850651,-0.447214}}, {0.482405,0.567101,-0.447214}}, {0.688416,0.28355,-0.447214}}, {0.894427,0,-0.447214}}, {0.688416,-0.28355,-0.447214}}, {0.482405,-0.567101,-0.447214}}, {0.276393,-0.850651,-0.447214}}, {
require 'net/http'
require 'json'
apikey = "YOURLASTFMAPIKEY" # your last.fm API key created from https://www.last.fm/api/account/create
apiroot = "http://ws.audioscrobbler.com/2.0/"
username = "aliekens" # your last.fm username
period = "12month" # overall | 7day | 1month | 3month | 6month | 12month
limit = "100" # how many results do you want?
require 'pp'
# parameters
minutes = 30 # how long to run the sim
packet_size_bytes = 25
packet_size_bits = packet_size_bytes * 8
channels = [ 12, 11, 10, 9, 8, 7, 6 ]
channel_bits_per_second = [ 0.293 * 1000, 0.537 * 1000, 0.976 * 1000, 1.757 * 1000, 3.125 * 1000, 5.468 * 1000, 9.375 * 1000 ]
channel_time_per_packet = channel_bits_per_second.map{ |bps| packet_size_bits / bps }