## Unanswered: PL SQL Line intersecting points

I require some help with the line intersection algorithm in PL SQl

I have worked with it on C programs, but not to sure how to create type and variables in PL SQL

I have written the code for the algorithm, i require help to create the data type and testing the algorithm.

Code:

-- How do i declare variables which will be data type number -- x1, y1, x2, y2, x3, y3, x4, y4,
--xc, yc;
--a1, a2, b1, b2, c1, c2; /* Coefficients of line eqns. */
-- lr1, r2, r3, r4; /* 'Sign' values */
-- denom, num; /* Intermediate values */

-- Bsign and Asign will have to be type boolean

a1:=y2-y1;
b1:=x1-x2;
c1:=x2*y1-x1*y2;

r3:= a1*x3+b1*y3+c1;
r4:= a1*x4+b1*y4+c1;

asign:=r3<0;
bsign:=r4<0;

if ( (r3!=0) and (r4!=0) and (asign = bsign) ) then
return 'False';
-- /* Check signs of r3 and r4. If both point 3 and point 4 lie on
-- * same side of line 1, the line segments do not intersect.
-- */

else
a2:= y4-y3;
b2:= x3-x4;
c2:= x4*y3-x3*y4;
r1:=a2*x1+b2*y1+c2;
r2:=a2*x2+b2*y2+c2;

asign:=r1<0;
bsign:=r2<0;

if (r1 != 0) and (r2 != 0) and (asign =bsign) then
return 'False';

/* Check signs of r1 and r2. If both point 1 and point 2 lie
* on same side of second line segment, the line segments do
* not intersect.
*/

else

denom :=a1*b2-a2*b1;
if(denom=0) then
return 'NULL';
--they are collinear
else

num:=b1*c2-b2*c1;
xc:= num/denom;
xc:=a2*c1-a1*c2;
yc:= num/denom;

return 'True';
---- This shows they intersect. HOW can i code to get output for
--intersection points xc yx?

end if;
end if;
end if;