Billiard game problem

Hello friends,
I'm developing a billiard game and I have a problem with ApplyImpulse method. Please check the following image:
Image

The code of the each ball is:
Code:
var friction:Number = 0.05;
var density:Number = 1;
var resituttion:Number = 0.8;
var linearDumping:Number = 0;

var body:b2Body;
var bodyDef:b2BodyDef;
var boxShape:b2CircleShape;
bodyDef = new b2BodyDef();
bodyDef.type = b2Body.b2_dynamicBody;
bodyDef.position.Set(xPos / _drawScale, yPos / _drawScale);
bodyDef.bullet = true;
boxShape = new b2CircleShape(_ballRadius / _drawScale);
var fixtureDef:b2FixtureDef = new b2FixtureDef();
fixtureDef.shape = boxShape;
fixtureDef.friction = friction;
fixtureDef.density = density;
fixtureDef.restitution = resituttion;         
body = _world.CreateBody(bodyDef);
body.SetFixedRotation(true);
body.SetSleepingAllowed(true);
body.SetBullet(true);
body.CreateFixture(fixtureDef);
body.SetLinearDamping(linearDumping);
Please note that I set the linearDumping to 0, because of the testing purpose. To make the ball's movement close to the real billiard ball the linearDumping should be high.

Here is how I calculate the b2Vec which I'm using in ApplyImpulse:
Code:
var h:Number = Math.sqrt(Math.pow(_sightXPos - _cueBall.xPos, 2) + Math.pow(_sightYPos - _cueBall.yPos, 2));
var x:Number = Math.sin((_sightXPos - _cueBall.xPos) / h);
var y:Number = Math.sin((_sightYPos - _cueBall.yPos) / h);
ball.body.ApplyImpulse(new b2Vec2(x, y), ball.body.GetPosition());

_sightXPos and _sightYPos are the coords of point B (on the image), _cueBall.xPos and _cueBall.yPos are the coords of point A.
So my question is why the ball goes on the white line path and not on the black line path.

P.S.
there is no gravity on the scene
could it be because you're calculating x like
var x:Number = Math.sin not Math.cos ? 🙂
Code:
var x:Number = Math.cos((_sightXPos - _cueBall.xPos) / h);
var y:Number = Math.sin((_sightYPos - _cueBall.yPos) / h);
Why do you need all that trigonometry? Can't you just do this?
Code:
b2Vec2 direction(_sightXPos - _cueBall.xPos, _sightYPos - _cueBall.yPos);
direction.Normalize();
ball.body.ApplyImpulse( strikePower * direction, ball.body.GetPosition());
Thank you for the answers.
vitaLee: yes you are right. I changed the calculation to Math.cos, but that doesn't fix the problem
irresistible force: thank you for the provided solution. It perfectly works.

Original thread: https://box2d.org/forum/viewtopic.php?t=5739