MROCGPointMath.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * MROCGPointMath.h
  3. *
  4. * Created by Marcus Rohrmoser on 21.09.10.
  5. *
  6. * Copyright (c) 2010-2015, Marcus Rohrmoser mobile Software
  7. * All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modification, are permitted
  10. * provided that the following conditions are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright notice, this list of conditions
  13. * and the following disclaimer.
  14. *
  15. * 2. The software must not be used for military or intelligence or related purposes nor
  16. * anything that's in conflict with human rights as declared in http://www.un.org/en/documents/udhr/ .
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  19. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  20. * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  21. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  24. * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  25. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. *
  27. */
  28. #include <CoreGraphics/CGGeometry.h>
  29. /** Similar to http://developer.apple.com/library/ios/documentation/Accelerate/Reference/vDSPRef/Reference/reference.html#//apple_ref/c/func/vDSP_vsadd */
  30. CGPoint CGPointAdd(const CGPoint a, const CGPoint b);
  31. CGPoint CGPointSub(const CGPoint a, const CGPoint b);
  32. /** Similar to http://developer.apple.com/library/ios/documentation/Accelerate/Reference/vDSPRef/Reference/reference.html#//apple_ref/c/func/vDSP_vsmul */
  33. CGPoint CGPointMul(const CGPoint a, const CGFloat f);
  34. /** Similar to http://developer.apple.com/library/ios/documentation/Accelerate/Reference/vDSPRef/Reference/reference.html#//apple_ref/c/func/vDSP_dotpr */
  35. CGFloat CGPointDotPr(const CGPoint a, const CGPoint b);
  36. CGFloat CGPointAbsSqr(const CGPoint a);
  37. /** Similar to http://developer.apple.com/library/ios/documentation/Accelerate/Reference/vDSPRef/Reference/reference.html#//apple_ref/c/func/vDSP_vabs */
  38. CGFloat CGPointAbs(const CGPoint a);
  39. bool CGPointDistanceSmallerThan(const CGPoint a, const CGPoint b, const CGFloat radius);