runelite-api: replace magic number in sine/cosine calculations with pi/1024
This commit is contained in:
@@ -26,15 +26,16 @@ package net.runelite.api;
|
||||
|
||||
public class Perspective
|
||||
{
|
||||
public static final int[] SINE = new int[2048];
|
||||
public static final int[] COSINE = new int[2048];
|
||||
private static final double UNIT = Math.PI / 1024d; // How much of the circle each unit of SINE/COSINE is
|
||||
public static final int[] SINE = new int[2048]; // sine angles for each of the 2048 units, * 65536 and stored as an int
|
||||
public static final int[] COSINE = new int[2048]; // cosine
|
||||
|
||||
static
|
||||
{
|
||||
for (int i = 0; i < 2048; ++i)
|
||||
{
|
||||
SINE[i] = (int) (65536.0D * Math.sin((double) i * 0.0030679615D));
|
||||
COSINE[i] = (int) (65536.0D * Math.cos((double) i * 0.0030679615D));
|
||||
SINE[i] = (int) (65536.0D * Math.sin((double) i * UNIT));
|
||||
COSINE[i] = (int) (65536.0D * Math.cos((double) i * UNIT));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user