Problem with getting headRotation of player

Hello everyone, i have a little problem with getting the rotation of head of player.
For my plugin, i need to get the Yaw, to calculate the velocity to add to the player to jump him forward.
The problem ?
It’s when i get the Yaw of me and my friend, for my, when the Yaw is at -1, it remains at -1, but when my friend is at -1, the Yaw become 359.
I don’t understand :confused:
My code:

Blockquote
private Vector3d getPropulsionVector(Player p){
Vector3d vector3d = new Vector3d(0, 0, 0);
double yaw = p.getHeadRotation().getY();
Sponge.getServer().getBroadcastChannel().send(Text.of(“Yaw: §a”+yaw));
if(yaw >= 0 && yaw <= 90){
//SOUTH-WEST
//x-
//z+
double per = (100yaw)/90;
double x = 0.1
per;
double z = 10-x;
vector3d = new Vector3d(-x, 4, z);
}else if(yaw >= 90 && yaw <= 180){
//WEST-NORTH
//x-
//z-
yaw -= 90;
double per = (100yaw)/90;
double x = 0.1
per;
double z = 10-x;
vector3d = new Vector3d(-x, 4, -z);
}else if(yaw <= -90){
//NORTH-EAST
//x+
//z-
yaw = -yaw;
yaw -= 90;
double per = (100yaw)/90;
double x = 0.1
per;
double z = 10-x;
vector3d = new Vector3d(x, 4, -z);
}else if(yaw >= -90 && yaw <= 0){
//SUD-EST
//x+
//z+
yaw = -yaw;
double per = (100yaw)/90;
double x = 0.1
per;
double z = 10-x;
vector3d = new Vector3d(x, 4, z);
}
Sponge.getServer().getBroadcastChannel().send(Text.of("§2Values of vector: "+vector3d));
return vector3d;
}

Perhaps someone know why i do not find the same number ?
Thanks for answers ! :smile: