runelite-api/src/main/java/net/runelite/api/Perspective.java
/**
	 * Translates two-dimensional ground coordinates within the 3D world to
	 * their corresponding coordinates on the Minimap.
	 *
	 * @param client
	 * @param x ground coordinate on the x axis
	 * @param y ground coordinate on the y axis
	 * @param distance max distance from local player to minimap point
	 * @return a {@link Point} on screen corresponding to the position in
	 * 3D-space
	 */
Translates two-dimensional ground coordinates within the 3D world to
their corresponding coordinates on the Minimap.


Translates two - dimensional ground coordinates within the 3D world to their corresponding coordinates on the Minimap .
public static Point worldToMiniMap(@Nonnull Client client, int x, int y, int distance)
	{
		int angle = client.getMapAngle() & 0x7FF;
		LocalPoint localLocation = client.getLocalPlayer().getLocalLocation();
		x = x / 32 - localLocation.getX() / 32;
		y = y / 32 - localLocation.getY() / 32;
		int dist = x * x + y * y;
		if (dist < distance)
		{
			int sin = SINE[angle];
			int cos = COSINE[angle];
			int xx = y * sin + cos * x >> 16;
			int yy = sin * x - y * cos >> 16;
			int miniMapX = client.isResized()
				? client.getCanvas().getWidth() - 167
				: Constants.GAME_FIXED_WIDTH - 208;
			x = (miniMapX + 167 / 2) + xx;
			y = (167 / 2 - 1) + yy;
			return new Point(x, y);
		}
		return null;
	}
public static Point worldToMiniMap ( @ Nonnull Client client , int x , int y , int distance ) { int angle = client . getMapAngle ( ) & 0x7FF ; LocalPoint localLocation = client . getLocalPlayer ( ) . getLocalLocation ( ) ; x = x / 32 - localLocation . getX ( ) / 32 ; y = y / 32 - localLocation . getY ( ) / 32 ; int dist = x * x + y * y ; if ( dist < distance ) { int sin = SINE [ angle ] ; int cos = COSINE [ angle ] ; int xx = y * sin + cos * x >> 16 ; int yy = sin * x - y * cos >> 16 ; int miniMapX = client . isResized ( ) ? client . getCanvas ( ) . getWidth ( ) - 167 : Constants . GAME_FIXED_WIDTH - 208 ; x = ( miniMapX + 167 / 2 ) + xx ; y = ( 167 / 2 - 1 ) + yy ; return new Point ( x , y ) ; } return null ; }
Translates two-dimensional ground coordinates within the 3D world to
 their corresponding coordinates on the Minimap.
Translates two - dimensional ground coordinates within the 3D world to their corresponding coordinates on the Minimap .