Formula for a pendelum movement in cocos2d-x?

Good day to all programmers! :)
I would like to ask if it is possible to achieve a movement using setPosition and formula to calculate for speed of movement.
similar to a pendelum thingy using cocos2d-x and without box2d physics? Attached to this question is an image of what I’m trying to achieve.
Any help is very much appreciated! :
)


images.jpg (3.6 KB)