<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/Math.rotVecToEulerAngle?action=history&amp;feed=atom</id>
	<title>Math.rotVecToEulerAngle - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/Math.rotVecToEulerAngle?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Math.rotVecToEulerAngle&amp;action=history"/>
	<updated>2026-04-03T17:42:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Math.rotVecToEulerAngle&amp;diff=72061&amp;oldid=prev</id>
		<title>Thisdp: Created page with &quot;{{Useful Function}} ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt;float float float math.rotVecToEulerAngle( float x, float y, float z, float rot )&lt;/syntaxhighlight&gt;  ===Required Arg...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Math.rotVecToEulerAngle&amp;diff=72061&amp;oldid=prev"/>
		<updated>2021-09-14T12:23:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Useful Function}} ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float float float math.rotVecToEulerAngle( float x, float y, float z, float rot )&amp;lt;/syntaxhighlight&amp;gt;  ===Required Arg...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Useful Function}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float float float math.rotVecToEulerAngle( float x, float y, float z, float rot )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''x''': A float of the x of the rotation vector.&lt;br /&gt;
* '''y''': A float of the y of the rotation vector.&lt;br /&gt;
* '''z''': A float of the z of the rotation vector.&lt;br /&gt;
* '''rot''': A float of the rotation of the rotation vector.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns three floats indicates rotX, rotY and rotZ.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function math.rotVecToEular( x, y, z, rot ) &lt;br /&gt;
	local rotx = math.deg( math.atan2 ( z, (x^2+y^2)^0.5 ) ) % 360&lt;br /&gt;
	local rotz = -math.deg( math.atan2( x, y ) ) % 360&lt;br /&gt;
	return rotx, rot, rotz&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local x,y,z,rot = 1,0,0,0&lt;br /&gt;
print( math.rotVecToEular( x, y, z, rot )  )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Thisdp</name></author>
	</entry>
</feed>