All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.brashmonkey.spriter.SpriterPoint Maven / Gradle / Ivy

There is a newer version: 1.1
Show newest version
package com.brashmonkey.spriter;

public class SpriterPoint {
	
	public float x,y;
	
	public SpriterPoint(float x, float y){
		this.set(x, y);
	}
	
	public void translate(float x, float y){
		this.x += x;
		this.y += y;
	}
	
	public void set(float x, float y){
		this.x = x;
		this.y = y;
	}
	
	public void rotate(float degree){
		double angle = Math.toRadians(degree);
		float cos = (float)Math.cos(angle);
		float sin = (float)Math.sin(angle);
		
		float xx = x*cos-y*sin;
		float yy = x*sin+y*cos;
		
		this.x = xx;
		this.y = yy;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy