blob: 402a64c1f96293b42fa7059338c5998ef5792335 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package main
import (
"log"
"net/http"
"strconv"
"github.com/gorilla/mux"
)
// updateCenterOfMassHandler updates the center of mass in each node in tree with the given index
func updateCenterOfMassHandler(w http.ResponseWriter, r *http.Request) {
log.Println("Updating the center of mass")
vars := mux.Vars(r)
treeindex, _ := strconv.ParseInt(vars["treeindex"], 10, 0)
treeArray[treeindex].CalcCenterOfMass()
}
// updateTotalMassHandler updates the total mass in each node in the tree with the given index
func updateTotalMassHandler(w http.ResponseWriter, r *http.Request) {
log.Println("Updating the total mass")
vars := mux.Vars(r)
treeindex, _ := strconv.ParseInt(vars["treeindex"], 10, 0)
treeArray[treeindex].CalcTotalMass()
}
|