距离计算
This commit is contained in:
@ -27,7 +27,7 @@ class MeasureTriangle extends Measure {
|
||||
cal_distance(positions) {
|
||||
let p1 = this.cartesian3Towgs84(positions[0], this.viewer)
|
||||
let p2 = this.cartesian3Towgs84(positions[1], this.viewer)
|
||||
let dis = this.computeDistance([p1, p2])
|
||||
let dis = this.computeDistance2([p1, p2])
|
||||
p1.alt = p1.alt.toFixed(2)
|
||||
p2.alt = p2.alt.toFixed(2)
|
||||
if (p1.alt === p2.alt) {//水平边
|
||||
@ -128,10 +128,10 @@ class MeasureTriangle extends Measure {
|
||||
let positions2 = this.id_map.get(id2).positions
|
||||
let p1 = this.cartesian3Towgs84(positions1[0], this.viewer)
|
||||
let p2 = this.cartesian3Towgs84(positions1[1], this.viewer)
|
||||
let shuiping = this.computeDistance([p2, p1])
|
||||
let shuiping = this.computeDistance2([p2, p1])
|
||||
let p3 = this.cartesian3Towgs84(positions2[0], this.viewer)
|
||||
let p4 = this.cartesian3Towgs84(positions2[1], this.viewer)
|
||||
let d = this.computeDistance([p3, p4])
|
||||
let d = this.computeDistance2([p3, p4])
|
||||
let h = Math.abs(p3.alt - p4.alt)
|
||||
let x = Math.sqrt(Math.pow(h, 2) + Math.pow(d, 2))
|
||||
if (shuiping == 0.00) {
|
||||
|
Reference in New Issue
Block a user