As you mentioned, dx and dy represent change in x and change in y, respectively. That makes it a good candidate to represent the velocity of an object in two dimensions.
What is a CGVector?
-
14-07-2023 - |
Vra
After searching the documentation, I still cannot find a reasonable explanation for what a CGVector
is. The only times it is mentioned in the documentation is when it shows what its typedef
is.
struct CGVector {
CGFloat dx;
CGFloat dy;
};
typedef struct CGVector CGVector;
From basic geometry I know that dx
means delta x, or change in x. The same goes for dy
. With this knowledge, what is a CGVector
(or just any kind of vector) from a programming standpoint? If it helps, I am trying to understand a vector in the context of SpriteKit's SKPhysicsBody
and velocity.
Oplossing
Gelisensieer onder: CC-BY-SA met toeskrywing
Nie verbonde aan StackOverflow