korlibs / korlibs/korlibs-math-vector
KorMA shape ops producing inaccurate results when dealing with unit scales close to 0.001
- Dominant language
- Kotlin
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
I made an Android app which uses KorMA to detect collision between polygons. On large scales (each unit corresponds to 1.0), it works fine, but when I get to smaller scales, it seems to break for some reason, even though the documentation doesn't mention anything in that regard.
Normal behaviour:

Flawed behaviour examples (notice how it sometimes works on one side, but not the other):



My only guess that it could be a problem with orientation. What I mean is, my y-axis is negative above the origin, and positive below it. However, this still wouldn't explain some of the artefacts.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing KorMA polygon collision and shape operations with unit scales near 0.001, comparing them with scale 1.0 and the attached normal and flawed examples. Investigate whether coordinate orientation or small-scale arithmetic explains the artefacts; done means collision results remain accurate at the reported scales.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100