-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accurate transformation of pitch dimensions #297
Conversation
This commit is a rewrite of the "PitchDimensions" model. It implements two main features. 1. It implements piecewise linear transformations in each dimension (see Stats Perform MA3 docs, appendix 7) to reduce the error when transforming between different coordinate system. For example, a point that is inside the penalty area will remain inside the area after a transformation to a different coordinate system. 2. It makes it possible to compute distances between two points without having to transform the entire dataset to a metric coordinate system.
y = 1 - y | ||
point_base = replace( | ||
point_base, | ||
y=68 - point_base.y, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a bit of a magic number here. Can it be moved to some other place or to a 'constant' ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've replaced it by a constant + optimized it a bit more to avoid unneeded conversions between dimensions.
One minor comment. Other than that (and the merge conflict) happy to merge! |
- Avoid unneeded scaling of pitch dimensions - Use constant for default metric IFAB pitch dimensions
This PR is a complete rewrite of the "PitchDimensions" domain model. It implements the following main features.
BREAKING CHANGES:
This changes the interface of the
PitchDimensions
class.