Skip to content

Conversation

@bioinformatist
Copy link

@bioinformatist bioinformatist commented Nov 19, 2025

Generality

Though the angle_in_degrees of PolarLine represents for an angle, it's u32, and the Miri has no idea about the range. So the more general way is to use sin/cos for special cases.

Robustness

The trigonometric functions has unspecified precision at the moment, as well as the mul_add is targeted to the dedicated fma instruction. That means, it's possible for the line has a calculated position which is slightly "outside" the box, while the true location is "inside".

To solve it, a tolerance was added for judgement, then the final coordinates were restricted back to the border for accurate coordinates. This version works well with Miri.

This was referenced Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant