Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getSideVector(offset, point) {
const center = this.get('center');
const vector = [ point.x - center.x, point.y - center.y ];
if (!Util.isNil(offset)) {
const vecLen = vec2.length(vector);
vec2.scale(vector, vector, offset / vecLen);
}
return vector;
}
getSideVector(offset, point) {
const center = this.get('center');
const vector = [ point.x - center.x, point.y - center.y ];
if (!Util.isNil(offset)) {
const vecLen = vec2.length(vector);
vec2.scale(vector, vector, offset / vecLen);
}
return vector;
}