
Formula de Gauss - Poligono Irregular
Java
3.064 visualizaciones desde el 10 de Junio del 2020


Calculo del area de cualquier poligono irregular mediante sus coordenadas en X e Y
let a=[1, 2, 3, 4, 5, 6];
random(a); // [5]
random(a); // [2]
a=["el", "la", "los", "las"];
random(a); // "los"
random(a); // "la"
[1, 2, 3, 4, 5, 6].random();
Array.prototype.random = function(){
return this[Math.floor(Math.random() * this.length)];
}
$items = ['a', 'b', 'c', 'a', 'b', 'c'];
extractItems($items, 'a', 'c');
print_r($items); // ['b', 'b']
$items = [1, 2, 3, 4, 5, 6, 7, 8];
extractItems($items, 4, 5, 6, 7);
print_r($items); // [1, 2, 3, 8]
$items = [1, 1, 2, 1, 1];
extractItems($items, 1);
print_r($items); // [2]
extractItems(['a', 'b', 'c', 'a', 'b', 'c'], 'a', 'c') # ['b', 'b']
extractItems([1, 2, 3, 4, 5, 6, 7, 8], 4, 5, 6, 7) # [1, 2, 3, 8]
extractItems([1, 1, 1, 2, 1, 1], 1) # [2]
getElementsDictionary({'age': 25, 'name': "tom", 'city': "NY"}, ["name"]) # {'name': "tom"}
getElementsDictionary({'age': 25, 'name': "tom", 'city': "NY"}, ["name", "country"]) # {'name': "tom"}
getElementsDictionary({'age': 25, 'name': "tom", 'city': "NY"}, ["name", "age"]) # {'name': "tom", 'age': 25}
getElementsDictionary({'age': 25, 'name': "tom", 'city': "NY"}, ["parent", "state"]) # {}
getElementsDictionary({}, ["name", "age"]) # {}
getElementsDictionary({'age': 25, 'name': "tom", 'city': "NY"}, []) # {}
initializeArrayWithValues(5); // [0, 0, 0, 0, 0]
initializeArrayWithValues(10, ""); // ["", "", "", "", "", "", "", "", "", ""]