Более красивый вариант
<script src="raphael.js"></script>
<script src="jquery-1.2.3.js"></script>
<style media="screen">
#canvas {
height: 300px;
width: 500px;
background-color: #D3D3D3;
}
#r1 {
position:absolute;
left:0px;
top:0px;
width:1000px;
height:259px;
z-index:1;
}
</style>
<script>
$(document).ready(function(){
var paper = Raphael("canvas");
paper.clear();
var a=paper.path("M 25,5 L 50,100 ");
var b=paper.path("M18,53c0,50,80-50,80,0c0,50-80-50-80,0z");
var c=paper.path("M20,50c0,30,80-50,90,0c0,450-80-50-80,0z");
function point_to_path(a,b){
if (a.getTotalLength()<b.getTotalLength()){
a_max=a.getTotalLength()
}else{
a_max=b.getTotalLength()}
console.log(a_max);
var i = 0;
var i2=0
ptp_x = [];
ptp_y = [];
while (a_max > i) {
var ax=a.getPointAtLength(i).x.toFixed(0)*1
var ay=a.getPointAtLength(i).y.toFixed(0)*1
var cl= paper.circle(ax,ay, 0.7).attr("fill", "#FF0000").attr("stroke", "none");
//
a.toFront();
if (paper.getElementByPoint(ax, ay) === a)
{
b.toFront();
if (paper.getElementByPoint(ax, ay) === b)
{
ptp_x[i2] =ax;
ptp_y[i2]=ay;
console.log('внутри', ptp_x [i2], ptp_y [i2]); // точки внутри фигуры
var cl= paper.circle(ptp_x [i2],ptp_y [i2], 0.5).attr("fill", "#FFFF00").attr("stroke", "none");
}
}
//
i=i+1;
}}
point_to_path(b,c)
a.hide()
b.hide()
c.hide()
})</script>
<div id="r1">
<div id="canvas"></div>
</div>