getY
getY is a conventional getter method name used to obtain the vertical component of a two-dimensional coordinate or the Y position associated with an input event. It is typically provided alongside getX as part of a point, vector, or event class. The exact behavior and return type depend on the library, but the common purpose is to expose the Y value without exposing internal fields directly.
In 2D geometry and graphics, a Point or similar object may implement getY to return the second
Examples of usage across contexts include:
- In Java's AWT/Swing, a mouse-related getY typically returns the Y coordinate in the coordinate space of
- In Android, MotionEvent.getY returns the Y coordinate of the touch or pointer event relative to the
Because coordinate systems can differ (local vs global, transformed spaces, and device coordinates), developers should be