Created
December 5, 2012 00:23
-
-
Save mrsidique/4210634 to your computer and use it in GitHub Desktop.
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
| NSDictionary *notificationDictionary = [notification object]; | |
| //Extract the values | |
| float faceDirectionAngleValue = [[notificationDictionary valueForKey:@"faceDirectionValue"]floatValue]; | |
| float backStrokeRotationAngleValue = [[notificationDictionary valueForKey:@"backStrokeRotationAngleValue"]floatValue]; | |
| float forwardStrokeRotationAngleValue = [[notificationDictionary valueForKey:@"forwardStrokeRotationAngleValue"]floatValue]; | |
| //Use the absolute value for the display | |
| float absoluteFaceDirectionAngleValue = fabsf(faceDirectionAngleValue); | |
| float absoluteBackStrokeRotationAngleValue = fabsf(backStrokeRotationAngleValue); | |
| float absoluteForwardStrokeRotationAngleValue = fabsf(forwardStrokeRotationAngleValue); | |
| //Convert the value to a string | |
| faceDirectionValueString = [NSString stringWithFormat:@"%.1f", absoluteFaceDirectionAngleValue]; | |
| backStrokeRotationValueString = [NSString stringWithFormat:@"%.1f", absoluteBackStrokeRotationAngleValue]; | |
| forwardStrokeRotationValueString = [NSString stringWithFormat:@"%.1f", absoluteForwardStrokeRotationAngleValue]; | |
| //Transform opening/closing for all of the angle values | |
| PuttingMetricsValueTransformer* puttingMetricsValueTransformer = [[PuttingMetricsValueTransformer alloc] init]; | |
| faceDirectionOpeningString = [puttingMetricsValueTransformer transformFaceDirectionAngle:faceDirectionAngleValue]; | |
| backStrokeRotationOpeningString = [puttingMetricsValueTransformer transformBackStrokeRotationAngle:backStrokeRotationAngleValue]; | |
| forwardStrokeRotationOpeningString =[puttingMetricsValueTransformer transformBackStrokeRotationAngle:forwardStrokeRotationAngleValue]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment