Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Just a snippet, but it should work
- */
- const {
- roundedHeight,
- height,
- width
- } = this.props;
- const heightSq = Math.pow(roundedHeight - height, 2);
- const widthSq = Math.pow(width / 2, 2);
- const xSq = Math.pow(x, 2);
- /**
- * This will give `y` where 0 = same level as `height`. Maximum
- * value is `roundedHeight`.
- */
- let y = Math.round(Math.sqrt(heightSq * (1 - xSq/widthSq)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement