Last active
August 29, 2015 14:06
-
-
Save itod/ca07a59d5cdeebc6c122 to your computer and use it in GitHub Desktop.
Wave Function: 0.0-1.0, twice in 360º
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 0 == w:1.0 h:0.0 | |
| // 90 == w:0.0 h:1.0 | |
| // 180 == w:1.0 h:0.0 | |
| // 270 == w:0.0 h:1.0 | |
| // 360 == w:1.0 h:0.0 | |
| CGFloat rad = TDD2R(angle); | |
| CGFloat wRatio = 0.5+(cos(2.0*rad)/2.0); | |
| CGFloat hRatio = 1.0 - wRatio; | |
| NSLog(@"angle: %g {w:%g, h:%g}", angle, wRatio, hRatio); | |
| w = w * wRatio; | |
| h = h * hRatio; | |
| // 0 == w:1.0 h:0.0 | |
| // 45 == w:0.0 h:1.0 | |
| // 90 == w:1.0 h:0.0 | |
| // 135 == w:0.0 h:1.0 | |
| // 180 == w:1.0 h:0.0 | |
| CGFloat rad = TDD2R(angle); | |
| CGFloat wRatio = 0.5+(cos(4.0*rad)/2.0); | |
| CGFloat hRatio = 1.0 - wRatio; | |
| NSLog(@"angle: %g {w:%g, h:%g}", angle, wRatio, hRatio); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://www.regentsprep.org/Regents/math/algtrig/ATT7/sinusoidal.htm
https://www.desmos.com/calculator/zrdgp3xxux