function getRandomPerimenterPoint() {
const angle = getRandomAngle();
if (angle < cornerAngles[0] || angle >= cornerAngles[3]) {
return [-w, -w * Math.tan(angle)];
} else if (angle < cornerAngles[1]) {
return [-h / Math.tan(angle), -h];
} else if (angle < cornerAngles[2]) {
return [w, w * Math.tan(angle)];
} else if (angle < cornerAngles[3]) {
return [h / Math.tan(angle), h];
}
}