How can I make a pendulum using BodyPosition (or any force)?

Hello

I am trying to create a pendulum motion by using the roblox physics and not CFrame or Position.
I found some tutorials on how to do that with cframes/positions however I cannot find a way to use a force to do it.

local Bob = workspace.Pendulum.Bob
local Origin = workspace.Pendulum.Origin
local run = game:GetService("RunService")
local length = (Origin.Position - Bob.Position).magnitude
local theta = math.rad(45) 
local AngVelocity = math.rad(1)


run.Heartbeat:Connect(function()
	local XArc = length * math.sin(theta)
	local YArc = length * math.cos(theta)
	
	Bob.BodyPosition.Position = Vector3.new(XArc, YArc, 0) + Origin.Position
	
	AngVelocity = (AngVelocity + (0.01*math.sin(theta)))
	
	theta = theta + AngVelocity
end)

This is the result I am getting:

This is what I want to happen:

All I changed in the code is

local theta = math.deg(45) 
Bob.Position = Vector3.new(XArc, YArc, 0) + Origin.Position

Take your initial theta and throw it into a trig function like this to produce a new angle which represents the pendulum’s current angle:

local pendulumAngle = math.sin(theta / frequency / math.pi) * amplitude

The pendulum’s oscillation angle is the amplitude here. Maybe -45 degrees to 45 degrees or so?