"""
    rotation matrix: z-axis 
"""
function rotation_matrix(x) 
    [cos(x) -sin(x); sin(x) cos(x)] 
end

"""
    rotation matrix: vector to vector
"""
function vector_rotation_matrix(ns; nw=[0.0; 1.0])
	a = atan(nw[2], nw[1]) - atan(ns[2], ns[1])
    rotation_matrix(a)
end

""" 
    scientific notation 
"""
function scn(a::Number; digits::Int=1, exp_digits::Int=1)
	typeof(a) <: Float64 ? nothing : return nothing
end

function scn(a::Float64; digits::Int=1, exp_digits::Int=1)
	@assert digits >= 0
    # a = m x 10^e
    if a == 0
        e = 0
        m = 0.0
    else
        e = Int(floor(log(abs(a))/log(10)))
        m = a*exp(-e*log(10))
    end

    m = round(m, digits=digits)
	if m == 10.0
		m = 1.0
		e += 1
	end
    if digits == 0
        m = Int(floor(m))
		strm = string(m)
	else
		strm = string(m)
		is_neg = m < 0.
		strm = strm*"0"^max(0, 2+digits+is_neg-length(strm))
    end
    sgn = a >= 0 ? " " : ""
    sgne = e >= 0 ? "+" : "-"

	stre = string(abs(e))
	stre = "0"^max(0, exp_digits - length(stre)) * stre
    return "$sgn$(strm)e$sgne$(stre)"
end