Skip to content

Add support for ^(::Rotation, ::Real) #164

@JurajLieskovsky

Description

@JurajLieskovsky

Hi, recently I've found a need for scaling rotations described by unit quaternions, by which I mean produce a rotation along the same axis only with a different angle. I've written a small function for this purpose

function scale(q::Q,w::Real) where Q <: UnitQuaternion
	θ = rotation_angle(q)
	axis = rotation_axis(q)
	s,c = sincos(w*θ/2)
	return Q(c,s*axis[1],s*axis[2],s*axis[3],false)
end

not wanting to override the current function (*)(q::Q, w::Real) where Q<:UnitQuaternion. Would any one else see use in adding such a method to the package?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions