# How to calculate the magnitude of the drag in Corona-sdk?

I'm making a game on Corona that launches a ball.

The force is based on the magnitude of the drag: the larger is the drag -> the higher is the force.

I'm having some trouble to do this, because I can't calculate the magnitude of the drag.

I tried a simple (finalX - initialX) but that's not a good idea.

local function onTouch(event)

if "began" == event.phase then

end
if "ended" == event.phase then
local finalX = event.x
local finalY = event.y

forceX = event.x - event.xStart
forceY = event.y - event.yStart

print(forceX, forceY)

end
end

local function gameComponents()
local crate = display.newImageRect( "images/sonic.png", 90, 90 )
crate.x, crate.y = 60, 360
crate.rotation = 0
--physics.addBody( crate, "static", { friction=0.3} )

return crate

end

local Game = {}
Game.new = gameComponents
return Game


dx = event.x - event.xStart