convex_hull_btn.onPress = function(){
var punto = new Point()
var Points = new Array();
pivot.x = Number.POSITIVE_INFINITY;
pivot.y = Number.POSITIVE_INFINITY;
for (var i = 0; i < kreisArr[index].length - 1; i++){
punto.x = kreisArr[index][i]._x;
punto.y = kreisArr[index][i]._y;
Points.push(dot);
if(punto.y < pivot.y){
pivot = punto;
}
else if(punto.y == pivot.y){
if(punto.x < pivot.x){
pivot = punto;
}
}
}
}
Quiesiera saber por qué despues de hacer un push en el array Points, todos los anteriores puntos que ya se habían insertado se convierten en el nuevo, es decir a cada nueva inserción todos los puntos tienen el mismo valor en "x" y en "y" que el último valor insertado. No logro entender que hago mal. ¿podeis ayudarme? muchisimas gracias.
