Rotating in one direction only with physics

Hello

Im trying to get a concept right here. I would like to be able to swipe in one direction only and not to the left and also use physics on the rotation so that it accelerates/decelerates according to the speed of the swipe, this would apply only to the swipe in the radius area, nowhere else.

Right now im only able to drag both directions and with a static speed, i ideally want a wheel on a pivot which i can spin as fast or slow as possible.

local physics = require(“physics”)
physics.start()
physics.setGravity( 0, 9.8 )

–Rotate object based on sliding the finger on the screen

–Variables used locally
local rect
local startX, startY
local dX, dY

local amountToRotate

–Functions
onTouch = function(event)
if event.phase==“began” then
startX = event.x
startY = event.y
elseif event.phase==“ended” then

elseif event.phase ==“moved” then
dX = startX + event.x
dY = startY + event.y

rect.rotation = (dX * amountToRotate)
end
end

amountToRotate = (360/display.contentHeight)
display.newImage( “puck_green.png”,100,100)
rect = display.newImage( “puck_green.png”,100,100)

physics.addBody( rect, “kinematic”, { density=0.0, friction=-100, radius=66})

Runtime:addEventListener(“touch”, onTouch) [import]uid: 43191 topic_id: 7519 reply_id: 307519[/import]