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
# Goal: substitute each letter in the word "while" with the corresponding alternate. | |
# Option 0 — does not work, error "many-to-many substitution not available" | |
lookup whileAttrCalt-0 useExtension { | |
ignore sub @AllLetters w' h i l e; | |
ignore sub w' h i l e @AllLetters; | |
sub w' h' i' l' e' by w.alt2 h.alt2 i.alt2 l.alt2 e.alt2; | |
} whileAttrCalt-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
var Vector = function(x, y) { | |
this.x = x || 0; | |
this.y = y || 0; | |
}; | |
// return the angle of the vector in radians | |
Vector.prototype.getDirection = function() { | |
return Math.atan2(this.y, this.x); | |
}; |