Advertisement
Guest User

Untitled

a guest
May 27th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. class Spiral =
  2. {
  3. class Note {
  4. constructor(index) {
  5. this.pos = get_note_pos(i);
  6. }
  7. // blabla
  8. }
  9.  
  10. constructor() {
  11. this.z1_radius = math.pow( .3 , 1/this.notes ); // <-- radius of innermost note
  12. this.z1 = math.complex({ r:this.z1_radius, phi:τ/12 });
  13.  
  14. // Find ∂ s.t. spiral * (1+∂)^+1 and spiral * (1+∂)^-1 meet as single amonite-groove
  15. // i.e. outside edge 1 rev in = inside edge
  16. // z^12 * (1+∂) = 1/(1+∂) (12 hops => back to real numberline)
  17. // z^12 = (1+∂)^-2
  18. // 1+∂ = z^12 ^ -1/2 = z^-6
  19. this.amonite_∂ = math.pow( this.z1_radius, -6 ) - 1;
  20.  
  21. // equation of spiral: z(ϕ) = z1^(wϕ)
  22. // with w chosen s.t. z(τ/12) = z1^1 = z1
  23. // i.e. z1^(w.τ/12) = z1^1, so w.τ/12=1, so w=12/τ
  24. // so: z(ϕ) = z1^(ϕ.12/τ)
  25. // length of spine for button 0
  26. // ∫z^(wϕ) dϕ over [-τ/24, +τ/24] (with w s.t. ϕ=τ/12 gives wϕ=1 i.e. w=12/τ)
  27. // i.e. at angle τ/12, we want z^1
  28. this.arc_0 = (root_r - 1/root_r) * τ / ( 12 * Math.log(r) );
  29.  
  30. this.notes = new Array(88);
  31. for( i=0; i<this.notes.length; i++ )
  32. this.notes[i] = new Note(i);
  33.  
  34.  
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement