I am inserting a value on 3 position the value is being inserted but somehow while copying the rest part it does not copy the last point. The size of an array is not increasing. Can anyone tell me how to add new elements in an array in between.
for(indexpoint=0;indexpoint<3;indexpoint++)
{
temp.points[indexpoint].x = intpoints[indexpoint].x+this.x;
temp.points[indexpoint].y = intpoints[indexpoint].y+this.y;
}
temp.points[3].x = (intpoints[2].x+intpoints[3].x)/2+this.x;
temp.points[3].y = (intpoints[2].y+intpoints[3].y)/2+this.y;
for(indexpoint=3;indexpoint<intpoints.length;indexpoint++)
{
temp.points[indexpoint+1].x = intpoints[indexpoint].x+this.x;
temp.points[indexpoint+1].y = intpoints[indexpoint].y+this.y;
}