Calculate accelerometer values from border (phone)

Hi guys, I’m new in that community :grin:

I want to get the value from accelerometer but with the phone border (like a ruler).

I try that:

this.x = event.accelerationIncludingGravity.x;
this.y = event.accelerationIncludingGravity.y;
this.z = event.accelerationIncludingGravity.z;

The problem is that it’s take values with the mobile face up and the purpose I want to achieve is to take the degrees as if it were an angle transporter or a goniometer.

Thanks all ^^

PD: sorry my english heheh

Something like: Screen orientation angle in JS, but this not work: