Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am trying to build a basic color approximation model for a website. I think the HSL would be the most efficient model to use. I remember from school the formulae for a cylinder is $$\pi r^2 h$$

height = L, S = radius and I am given an angle for H. Given an HSL value, how do I convert it to X, Y, Z coordinates?

share|improve this question
    
$\pi r^2h$ is the formula for the volume of a cylinder and has nothing to do with the calculation you're after. –  jwodder Feb 22 '12 at 1:54
    
do you know what i need then? –  marabutt Feb 22 '12 at 1:56
add comment

1 Answer 1

up vote 1 down vote accepted

Assuming that the height $L$ is the height above the $xy$-plane, $z$ obviously equals $L$.

By basic trigonometry, a point in the $xy$-plane a distance $r$ from the origin and at an angle of $\theta$ from the $x$-axis is located at $(r\cos\theta, r\sin\theta)$, and this formula is preserved when the plane is translated upward/downward.

Thus (using $H$ to represent the angle itself):

$$\begin{eqnarray*} x & = & S\cos H \\ y & = & S\sin H \\ z & = & L \end{eqnarray*}$$

share|improve this answer
    
awesome, thanks –  marabutt Feb 22 '12 at 2:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.