This file contains 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
/** | |
* Turns your ship to the given angle. Returns true when it is within | |
* epsilon radians of the target angle and the angular velocity is zero. | |
* | |
* @param {Number} angle | |
* @param {Number} [epsilon] Defaults to 0.001 | |
* @return {Boolean} True if the operation is complete | |
*/ | |
var servo = function(angle, epsilon) { | |
// Set a default value for epsilon |
This file contains 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
/** | |
* Turns your ship to the given angle. Returns true when it is within | |
* epsilon radians of the target angle and the angular velocity is zero. | |
* | |
* @param {Number} angle | |
* @param {Number} [epsilon] Defaults to 0.001 | |
* @return {Boolean} True if the operation is complete | |
*/ | |
var servo = function(angle, epsilon) { | |
// Set a default value for epsilon |
This file contains 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
def get_centroid(poly): | |
"""Calculates the centroid of a non-intersecting polygon. | |
Args: | |
poly: a list of points, each of which is a list of the form [x, y]. | |
Returns: | |
the centroid of the polygon in the form [x, y]. | |
Raises: | |
ValueError: if poly has less than 3 points or the points are not | |
formatted correctly. | |
""" |