Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. /**
  2. * Just a snippet, but it should work
  3. */
  4. const {
  5. roundedHeight,
  6. height,
  7. width
  8. } = this.props;
  9.  
  10. const heightSq = Math.pow(roundedHeight - height, 2);
  11. const widthSq = Math.pow(width / 2, 2);
  12. const xSq = Math.pow(x, 2);
  13. /**
  14. * This will give `y` where 0 = same level as `height`. Maximum
  15. * value is `roundedHeight`.
  16. */
  17. let y = Math.round(Math.sqrt(heightSq * (1 - xSq/widthSq)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement