## Rotation

This function transforms a Euler rotation from one space to another.

### Syntax

• Vec3 Rotation(Vec3 rotation, Entity src, Entity dst)
• Vec3 Rotation(number pitch,number yaw,number roll, Entity src, Entity dst)
• Quat Rotation(Quat rotation, Entity src, Entity dst)
• Vec3 Rotation(Vec3 rotation, Mat4 src, Mat4 dst)
• Vec3 Rotation(number pitch, number yaw,number roll, Mat4 src, Mat4 dst)
• Quat Rotation(Quat rotation, Mat4 src, Mat4 dst)

### Parameters

• rotation: the rotation to be transformed.
• x: the X component of the rotation to be transformed.
• y: the Y component of the rotation to be transformed.
• z: the Z component of the rotation to be transformed.
• src: the source entity or 4x4 matrix to transform the rotation from.
• dst: the destination entity or 4x4 matrix to transform the rotation to.

### Returns

Returns the transformed rotation.

### Example

`--Create a window        window = Window:Create()        context = Context:Create(window)        world = World:Create()        local camera = Camera:Create()         camera:Move(0,0,-3)         local light = DirectionalLight:Create()         light:SetRotation(35,35,0)                 --Create a model        model = Model:Box()         model:SetColor(0.0,0.0,1.0)         model:SetRotation(0,45,0)        while true do        if window:Closed() or window:KeyHit(Key.Escape) then return false end        Time:Update()        world:Update()        world:Render()        --We're going to transform the euler angle (0,60,0) from global space to the model's local space        --Because the model is rotated to (0,45,0) the rotation will be at (0,15,0) in local space (relative to the model).        local v = Transform:Rotation(0,60,0,nil,model)        context:SetBlendMode(Blend.Alpha)         context:DrawText(v:ToString(),2,2)         context:SetBlendMode(Blend.Solid)         context:Sync()        end`