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
// thx tomy! http://www5.airnet.ne.jp/tomy/cpro/sslib12.htm | |
function cartesian2polar(x,y,z) { | |
var obj = new Object; | |
obj.r = Math.sqrt( x*x + y*y + z*z ); | |
if (x != 0.0) | |
obj.phi = Math.atan2( y, x ); | |
else { | |
if (y < 0.0) |
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
function polarToCartesian(radius,radian){ | |
return { | |
x:radius*Math.cos(radian), | |
y:radius*Math.sin(radian) | |
} | |
} |
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
function cartesianToPolar(x,y){ | |
return { | |
radius: Math.sqrt( Math.pow(x, 2) + Math.pow(y, 2) ), | |
alpha: Math.atan2(y, x) | |
} | |
} |
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
/** | |
* Coordinates Transformations | |
* | |
* http://stackoverflow.com/questions/5736398/how-to-calculate-the-svg-path-for-an-arc-of-a-circle | |
* | |
* @param centerX | |
* @param centerY | |
* @param radius | |
* @param angleInDegrees | |
* @returns {string} |
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
# -*- coding: utf8 -*- | |
# this is from django.utils.module_loading | |
from importlib import import_module | |
def import_string(dotted_path): | |
""" | |
Import a dotted module path and return the attribute/class designated by the | |
last name in the path. Raise ImportError if the import failed. | |
""" |
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
(function(){ | |
function addLink(target) { | |
var div = document.createElement('div'); | |
var a = document.createElement('a'); | |
a.setAttribute('href', '#'); | |
a.textContent = 'No media in post'; | |
a.addEventListener('click', function(e){ | |
if (target.style.display == "none") { | |
target.removeAttribute('style'); | |
} else { |
OlderNewer