diff options
author | Andrew Cady <d@jerkface.net> | 2014-01-19 20:33:40 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2014-01-19 20:33:40 -0500 |
commit | 09a78e65b503437f3defaac924a4ea316e8f7f62 (patch) | |
tree | 1799bafcce76b85394025bb005ed37926f29a208 | |
parent | e2c1145e5f52c7c57feb8831275732b095b36e02 (diff) |
fix forgotten term in trig equation
-rw-r--r-- | axis.hs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -111,7 +111,7 @@ inMajorC pclass = not (pclass == 1 || pclass == 3 || pclass == 6 || pclass == 8 | |||
111 | pitchToColor p = | 111 | pitchToColor p = |
112 | case p `mod` 12 of | 112 | case p `mod` 12 of |
113 | 2 -> (SDL.Color 0xD0 0xD0 0xFF) -- D | 113 | 2 -> (SDL.Color 0xD0 0xD0 0xFF) -- D |
114 | 8 -> _CGA !! 1 -- G# | 114 | 8 -> (SDL.Color 0x55 0x55 0x88) -- G# |
115 | x | inMajorC x -> (SDL.Color 0xE0 0xE0 0xE0) -- _CGA !! 7 | 115 | x | inMajorC x -> (SDL.Color 0xE0 0xE0 0xE0) -- _CGA !! 7 |
116 | _ -> _CGA !! 8 | 116 | _ -> _CGA !! 8 |
117 | 117 | ||
@@ -146,7 +146,9 @@ drawKey' idx videoSurface font axis_key_locations axis_key_size fillColor border | |||
146 | Control.Monad.when (len /= 0) $ do | 146 | Control.Monad.when (len /= 0) $ do |
147 | forM_ [0 .. len - 1] $ \i -> do | 147 | forM_ [0 .. len - 1] $ \i -> do |
148 | let (x', y') = if len == 1 then (0, 0) | 148 | let (x', y') = if len == 1 then (0, 0) |
149 | else (d * cos(pi/3 * fromIntegral(i)), d * sin(pi/3 * fromIntegral(i))) | 149 | else (d * cos(2*pi/lenf * ifi), d * sin(2*pi/lenf * ifi)) |
150 | ifi = fromIntegral i | ||
151 | lenf = fromIntegral len | ||
150 | d = (fromIntegral axis_key_size) / 4 :: Float | 152 | d = (fromIntegral axis_key_size) / 4 :: Float |
151 | r' = (fromIntegral axis_key_size) / 2 :: Float | 153 | r' = (fromIntegral axis_key_size) / 2 :: Float |
152 | x'' = (round x') + (fromIntegral x) | 154 | x'' = (round x') + (fromIntegral x) |