- Emil Persson @Humus
 - Matt Pettineo @mynameismjp
 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>test</title> | |
| </head> | |
| <body> | |
| <br/> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>test</title> | |
| </head> | |
| <body> | |
| <canvas id="canvas"> </canvas> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>test</title> | |
| </head> | |
| <body> | |
| <canvas id="canvas"> </canvas> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import numpy as np | |
| import math | |
| g = 9.81 | |
| dt = 0.005 | |
| class Param: | |
| def __init__(self): | |
| self.mass = [1,1] | |
| self.length = [1,1] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | long a=10000,b,c=2800,d,e,f[2801],g; | |
| void main(){ | |
| for(;b-c;)f[b++] =a/5; | |
| for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a) | |
| for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | float Halton( int32 Index, int32 Base ) | |
| { | |
| float Result = 0.0f; | |
| float InvBase = 1.0f / Base; | |
| float Fraction = InvBase; | |
| while( Index > 0 ) | |
| { | |
| Result += ( Index % Base ) * Fraction; | |
| Index /= Base; | |
| Fraction *= InvBase; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # see : "Octahedron Environment Maps" by Thomas Engelhardt and Carsten Dachsbacher | |
| # https://pdfs.semanticscholar.org/fcb9/a6dbdf7b4c31f94e481cf101c83b73ea6410.pdf | |
| def xyz_to_oct_uv(vec): | |
| v = vec / np.sqrt(np.dot(vec, vec)) | |
| v = v / np.sum( np.abs(v) ) | |
| if v[1] < 0: | |
| x = (1-np.abs(v[2])) * np.sign(v[0]); | |
| z = (1-np.abs(v[0])) * np.sign(v[2]); | |
| else: | |
| x,z = v[0],v[2] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #define lowbit(x) (((x) ^ (x-1)) & (x)) | |
| typedef complex<long double> Complex; | |
| void FFT(vector<Complex> &A, int s){ | |
| int n = A.size(); | |
| int p = __builtin_ctz(n); | |
| vector<Complex> a = A; | |
| for(int i = 0;i<n;++i){ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // http://planning.cs.uiuc.edu/node102.html | |
| inline Mat4f YawPitchRowToMat4(float yaw, float pitch, float row) { | |
| Mat4f m; | |
| m.at(3,3) = 1; | |
| float sina = sin(yaw), cosa = cos(yaw); | |
| float sinb = sin(pitch), cosb = cos(pitch); | |
| float sinc = sin(row), cosc = cos(row); | |
| m.at(0,0) = cosa*cosb; | |
| m.at(0,1) = cosa*sinb*sinc - sina*cosc; | 
NewerOlder