DampGoodSanta
New member
- Joined
- Jul 7, 2023
- Messages
- 2
I’ve been do some geometry for a few days now, figuring out what percentage of an area of a 2d shape fits under a line at a given height% h, but when I’m making my formulas I keep running into a simplifying problem that makes them longer than what I think is necessary.
h is always between 0 and 1 as it is a % aswell.
to find some area for horizontally symmetrical shapes, e.g circle, diamond, I use the formula |[h]-h|, where the square brackets [ ] means round to the nearest integer. [h] is always 0 or 1, as h is always between the two. Subtracting h from [h] gives -h, if h<0.5, and 1-h if h>0.5. e.g if h is 0.25, the formula gives 0.25, but if h is 0.75, it also gives 0.25.
I was wondering if the was a simpler way of doing this to help simplify some of my equations.
What I would like is a way to turn 0.6 into 0.4, or 0.85 into 0.15, but also keep 0.4, and 0.2 the same for example.
Thanks
h is always between 0 and 1 as it is a % aswell.
to find some area for horizontally symmetrical shapes, e.g circle, diamond, I use the formula |[h]-h|, where the square brackets [ ] means round to the nearest integer. [h] is always 0 or 1, as h is always between the two. Subtracting h from [h] gives -h, if h<0.5, and 1-h if h>0.5. e.g if h is 0.25, the formula gives 0.25, but if h is 0.75, it also gives 0.25.
I was wondering if the was a simpler way of doing this to help simplify some of my equations.
What I would like is a way to turn 0.6 into 0.4, or 0.85 into 0.15, but also keep 0.4, and 0.2 the same for example.
Thanks