Calculates distance between point an origin
Class CCPoint
#include <Geode/cocos/cocoa/CCGeometry.h>
Examples0
Public static methods1
staticcocos2d::CCPointforAngle()
Public member functions33
cocos2d::CCPoint&operator=()
cocos2d::CCPoint&operator=()
cocos2d::CCPointoperator+()const
cocos2d::CCPointoperator-()const
cocos2d::CCPointoperator-()const
cocos2d::CCPointoperator*()const
cocos2d::CCPointoperator/()const
cocos2d::CCPointoperator*()const
cocos2d::CCPointoperator/()const
boolequals(cocos2d::CCPointconst&target)const
boolfuzzyEquals(,floatvar)const
floatgetLength()const
floatgetLengthSq()const
Calculates the square length of a CCPoint (not calling sqrt() )
floatgetDistanceSq()const
Calculates the square distance between two points (not calling sqrt() )
floatgetDistance()const
Calculates the distance between two points
floatgetAngle()const
floatgetAngle()const
floatdot()const
Calculates dot product of two points.
floatcross()const
Calculates cross product of two points.
cocos2d::CCPointgetPerp()const
Calculates perpendicular of v, rotated 90 degrees counter-clockwise – cross(v, perp(v)) >= 0
cocos2d::CCPointgetRPerp()const
Calculates perpendicular of v, rotated 90 degrees clockwise – cross(v, rperp(v)) <= 0
cocos2d::CCPointproject()const
Calculates the projection of this over other.
cocos2d::CCPointrotate()const
Complex multiplication of two points (“rotates” two points).
cocos2d::CCPointunrotate()const
Unrotates two points.
cocos2d::CCPointnormalize()const
Returns point multiplied to a length of 1. If the point is 0, it returns (1, 0)
cocos2d::CCPointlerp(,floatalpha)const
Linear Interpolation between two points a and b
cocos2d::CCPointrotateByAngle(,floatangle)const
Rotates a point counter clockwise by the angle around a pivot
pivot
angle