| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
package uk.me.parabola.imgfmt.app.net; |
| 14 |
|
| 15 |
import java.util.ArrayList; |
| 16 |
import java.util.Iterator; |
| 17 |
import java.util.List; |
| 18 |
import java.util.Map; |
| 19 |
|
| 20 |
import uk.me.parabola.log.Logger; |
| 21 |
import uk.me.parabola.util.EnhancedProperties; |
| 22 |
import uk.me.parabola.mkgmap.reader.osm.FakeIdGenerator; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
public class AngleChecker { |
| 67 |
private static final Logger log = Logger.getLogger(AngleChecker.class); |
| 68 |
|
| 69 |
private boolean ignoreSharpAngles; |
| 70 |
private boolean cycleMap; |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
private static final float COMPACT_DIR_DEGREES = 45+1; |
| 75 |
|
| 76 |
private static final float SHARP_DEGREES = COMPACT_DIR_DEGREES; |
| 77 |
|
| 78 |
private static final float MIN_ANGLE = 23f; |
| 79 |
private static final float STRAIGHT_EPSILON = 3f; |
| 80 |
|
| 81 |
|
| 82 |
private class ArcGroup { |
| 83 |
float initialHeading; |
| 84 |
int isOneWayTrueCount; |
| 85 |
int isForwardTrueCount; |
| 86 |
int maxRoadSpeed; |
| 87 |
int maxRoadClass; |
| 88 |
byte orAccessMask; |
| 89 |
List<RouteArc> arcs = new ArrayList<>(); |
| 90 |
|
| 91 |
public void addArc(RouteArc arc) { |
| 92 |
arcs.add(arc); |
| 93 |
if (arc.getRoadDef().isOneway()) |
| 94 |
isOneWayTrueCount++; |
| 95 |
if (arc.isForward()) |
| 96 |
isForwardTrueCount++; |
| 97 |
if (arc.getRoadDef().getRoadSpeed() > maxRoadSpeed) |
| 98 |
maxRoadSpeed = arc.getRoadDef().getRoadSpeed(); |
| 99 |
if (arc.getRoadDef().getRoadClass() > maxRoadClass) |
| 100 |
maxRoadClass = arc.getRoadDef().getRoadClass(); |
| 101 |
orAccessMask |= arc.getRoadDef().getAccess(); |
| 102 |
} |
| 103 |
|
| 104 |
public float getInitialHeading() { |
| 105 |
return initialHeading; |
| 106 |
} |
| 107 |
|
| 108 |
public boolean isOneway() { |
| 109 |
|
| 110 |
return isOneWayTrueCount == arcs.size(); |
| 111 |
} |
| 112 |
|
| 113 |
public boolean isForward() { |
| 114 |
return isForwardTrueCount == arcs.size(); |
| 115 |
} |
| 116 |
|
| 117 |
public boolean sameWay(ArcGroup other) { |
| 118 |
for (RouteArc thisArc : arcs) |
| 119 |
for (RouteArc otherArc : other.arcs) { |
| 120 |
|
| 121 |
if (thisArc.getRoadDef() == otherArc.getRoadDef()) |
| 122 |
return true; |
| 123 |
} |
| 124 |
return false; |
| 125 |
} |
| 126 |
|
| 127 |
public boolean sameName(ArcGroup other) { |
| 128 |
for (RouteArc thisArc : arcs) { |
| 129 |
String thisName = thisArc.getRoadDef().getName(); |
| 130 |
|
| 131 |
if (thisName != null) |
| 132 |
for (RouteArc otherArc : other.arcs) |
| 133 |
if (thisName.equals(otherArc.getRoadDef().getName())) |
| 134 |
return true; |
| 135 |
} |
| 136 |
return false; |
| 137 |
} |
| 138 |
|
| 139 |
public void modInitialHeading(float modIH) { |
| 140 |
initialHeading += modIH; |
| 141 |
if (initialHeading >= 180) |
| 142 |
initialHeading -= 360; |
| 143 |
else if (initialHeading < -180) |
| 144 |
initialHeading += 360; |
| 145 |
log.info("modInitialHeading arc from", arcs.get(0).getInitialHeading(), "by", modIH, "to", initialHeading); |
| 146 |
|
| 147 |
for (RouteArc arc : arcs) { |
| 148 |
arc.modInitialHeading(modIH); |
| 149 |
} |
| 150 |
} |
| 151 |
|
| 152 |
public String toString() { |
| 153 |
return arcs.get(0).toString(); |
| 154 |
} |
| 155 |
} |
| 156 |
|
| 157 |
public void config(EnhancedProperties props) { |
| 158 |
|
| 159 |
ignoreSharpAngles = props.getProperty("ignore-sharp-angles", false); |
| 160 |
cycleMap = props.getProperty("cycle-map", false); |
| 161 |
} |
| 162 |
|
| 163 |
public void check(Map<Integer, RouteNode> nodes) { |
| 164 |
if (!ignoreSharpAngles){ |
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
byte sharpAnglesCheckMask = cycleMap ? (byte) (0xff & ~AccessTagsAndBits.FOOT) : (byte) 0xff; |
| 185 |
for (RouteNode node : nodes.values()){ |
| 186 |
fixSharpAngles(node, sharpAnglesCheckMask); |
| 187 |
} |
| 188 |
} |
| 189 |
} |
| 190 |
|
| 191 |
public void fixSharpAngles(RouteNode node, byte sharpAnglesCheckMask) { |
| 192 |
|
| 193 |
List<RouteArc> arcs = node.getArcs(); |
| 194 |
if (arcs.size() <= 1) |
| 195 |
return; |
| 196 |
|
| 197 |
node.setUseCompactDirs(true); |
| 198 |
if (arcs.size() == 2) { |
| 199 |
doSimpleJoin(node, arcs); |
| 200 |
return; |
| 201 |
} |
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
List<RouteArc> directArcs = new ArrayList<>(); |
| 207 |
for (RouteArc arc : arcs) { |
| 208 |
if (arc.isDirect()) |
| 209 |
directArcs.add(arc); |
| 210 |
else |
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
log.warn("Unexpected indirect arc", arc, "from", node); |
| 215 |
} |
| 216 |
if (directArcs.size() <= 1) |
| 217 |
return; |
| 218 |
|
| 219 |
|
| 220 |
directArcs.sort((ra1,ra2) -> { |
| 221 |
int d = Float.compare(ra1.getInitialHeading(), ra2.getInitialHeading()); |
| 222 |
if (d != 0) |
| 223 |
return d; |
| 224 |
d = Integer.compare(ra1.getPointsHash(), ra2.getPointsHash()); |
| 225 |
if (d != 0) |
| 226 |
return d; |
| 227 |
return Long.compare(ra1.getRoadDef().getId() , ra2.getRoadDef().getId()); |
| 228 |
}); |
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
List<ArcGroup> arcGroups = new ArrayList<>(); |
| 233 |
Iterator<RouteArc> iter = directArcs.listIterator(); |
| 234 |
RouteArc arc1 = iter.next(); |
| 235 |
boolean addArc1 = false; |
| 236 |
float smallestAngle = 180; |
| 237 |
while (iter.hasNext() || addArc1) { |
| 238 |
ArcGroup ag = new ArcGroup(); |
| 239 |
ag.initialHeading = arc1.getInitialHeading(); |
| 240 |
ag.addArc(arc1); |
| 241 |
arcGroups.add(ag); |
| 242 |
addArc1 = false; |
| 243 |
while (iter.hasNext()) { |
| 244 |
RouteArc arc2 = iter.next(); |
| 245 |
float angleBetween = arc2.getInitialHeading() - ag.initialHeading; |
| 246 |
if (angleBetween < 1) { |
| 247 |
if (arc1.getDest() != arc2.getDest() && arc1.getRoadDef().getId() != arc2.getRoadDef().getId()) |
| 248 |
log.warn("sharp angle < 1° at", node.getCoord(), ",maybe duplicated OSM way with bearing", getCompassBearing(arc1.getInitialHeading())); |
| 249 |
ag.addArc(arc2); |
| 250 |
} else { |
| 251 |
if (angleBetween < smallestAngle) |
| 252 |
smallestAngle = angleBetween; |
| 253 |
arc1 = arc2; |
| 254 |
if (!iter.hasNext()) |
| 255 |
addArc1 = true; |
| 256 |
break; |
| 257 |
} |
| 258 |
} |
| 259 |
} |
| 260 |
|
| 261 |
int lastInx = arcGroups.size()-1; |
| 262 |
if (lastInx > 0) { |
| 263 |
float angleBetween = arcGroups.get(0).initialHeading - arcGroups.get(lastInx).initialHeading + 360; |
| 264 |
if (angleBetween < 1) { |
| 265 |
for (RouteArc arc : arcGroups.get(lastInx).arcs) |
| 266 |
arcGroups.get(0).addArc(arc); |
| 267 |
arcGroups.remove(lastInx); |
| 268 |
} else if (angleBetween < smallestAngle) { |
| 269 |
smallestAngle = angleBetween; |
| 270 |
} |
| 271 |
} |
| 272 |
|
| 273 |
if (smallestAngle >= SHARP_DEGREES && arcGroups.size() == arcs.size()) |
| 274 |
return; |
| 275 |
|
| 276 |
if (log.isInfoEnabled()) { |
| 277 |
log.info("fixSharpAngles at", node.getCoord(), |
| 278 |
"mask", String.format("0x%02x", sharpAnglesCheckMask), |
| 279 |
"nArcs", arcs.size(), |
| 280 |
|
| 281 |
arcGroups.size() < arcs.size() ? "nGroups " + arcGroups.size() : "", |
| 282 |
"smallestAngle", smallestAngle); |
| 283 |
float lastHeading = directArcs.get(directArcs.size()-1).getInitialHeading() - 360; |
| 284 |
for (RouteArc arc : directArcs) { |
| 285 |
RoadDef rd = arc.getRoadDef(); |
| 286 |
log.info("Arc", |
| 287 |
"heading", arc.getInitialHeading(), getCompassBearing(arc.getInitialHeading()), |
| 288 |
"angToPrev", arc.getInitialHeading() - lastHeading, |
| 289 |
"class", rd.getRoadClass(), |
| 290 |
"speed", rd.getRoadSpeed(), |
| 291 |
|
| 292 |
"way", rd.getId(), "isFake", FakeIdGenerator.isFakeId(rd.getId()), |
| 293 |
"name", rd.getName(), |
| 294 |
"access", String.format("0x%02x", rd.getAccess()), |
| 295 |
"oneway", rd.isOneway(), |
| 296 |
"forward", arc.isForward(), |
| 297 |
"paved", rd.paved() |
| 298 |
); |
| 299 |
lastHeading = arc.getInitialHeading(); |
| 300 |
} |
| 301 |
} |
| 302 |
|
| 303 |
if (arcGroups.size() == 1) { |
| 304 |
node.setUseCompactDirs(false); |
| 305 |
return; |
| 306 |
} else if (smallestAngle >= SHARP_DEGREES) |
| 307 |
return; |
| 308 |
|
| 309 |
final int n = arcGroups.size(); |
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
class AngleAttr { |
| 316 |
float angle; |
| 317 |
float minAngle; |
| 318 |
|
| 319 |
private boolean straightEnough() { |
| 320 |
return angle > 180-STRAIGHT_EPSILON && angle < 180+STRAIGHT_EPSILON; |
| 321 |
} |
| 322 |
|
| 323 |
} |
| 324 |
|
| 325 |
boolean someNeedIncrease = false; |
| 326 |
AngleAttr[] angles = new AngleAttr[n]; |
| 327 |
for (int i = 0; i < n; i++){ |
| 328 |
ArcGroup ag1 = arcGroups.get(i); |
| 329 |
ArcGroup ag2 = arcGroups.get(i+1 < n ? i+1 : 0); |
| 330 |
AngleAttr aa = new AngleAttr(); |
| 331 |
angles[i] = aa; |
| 332 |
aa.angle = ag2.getInitialHeading() - ag1.getInitialHeading(); |
| 333 |
if (i+1 >= n) |
| 334 |
aa.angle += 360; |
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
aa.minAngle = MIN_ANGLE; |
| 360 |
String minimalReason = null; |
| 361 |
byte pathAccessMask = (byte) (ag1.orAccessMask & ag2.orAccessMask); |
| 362 |
if (pathAccessMask == 0) |
| 363 |
minimalReason = "no common vehicle allowed on both arcs"; |
| 364 |
else if (pathAccessMask == AccessTagsAndBits.FOOT) |
| 365 |
minimalReason = "only pedestrians - sharp angle not a problem"; |
| 366 |
else if ((pathAccessMask & sharpAnglesCheckMask) == 0) |
| 367 |
minimalReason = "because it can not be used by bike"; |
| 368 |
else if (Math.min(ag1.maxRoadSpeed, ag2.maxRoadSpeed) == 0) |
| 369 |
minimalReason = "eg service/parking where sharp angle probably indicates shouldn't turn here"; |
| 370 |
else if (ag1.isOneway() && ag2.isOneway()) { |
| 371 |
if (!ag1.isForward() && !ag2.isForward()) { |
| 372 |
minimalReason = "two one-ways merge"; |
| 373 |
if (aa.angle < MIN_ANGLE) |
| 374 |
aa.minAngle = aa.angle; |
| 375 |
} else if (ag1.isForward() && ag2.isForward()) { |
| 376 |
minimalReason = "two one-ways split"; |
| 377 |
if (aa.angle < MIN_ANGLE && n == 3 && ag1.maxRoadClass == ag2.maxRoadClass && ag1.sameName(ag2)) { |
| 378 |
|
| 379 |
ArcGroup ag3 = arcGroups.get(i+2 < n ? i+2 : i+2-n); |
| 380 |
if (ag3.isOneway() && ag3.maxRoadClass == ag1.maxRoadClass) { |
| 381 |
minimalReason = "major road split"; |
| 382 |
aa.minAngle = aa.angle; |
| 383 |
node.setUseCompactDirs(false); |
| 384 |
} |
| 385 |
} |
| 386 |
} |
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
} |
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
if (minimalReason != null) { |
| 400 |
if (log.isInfoEnabled()) { |
| 401 |
log.info(aa.angle < aa.minAngle ? "minAngleSharp" : "minAngleOK", aa.angle, |
| 402 |
"minAngle", aa.minAngle, |
| 403 |
"reason", minimalReason); |
| 404 |
} |
| 405 |
} else |
| 406 |
aa.minAngle = SHARP_DEGREES; |
| 407 |
if (aa.angle < aa.minAngle) |
| 408 |
someNeedIncrease = true; |
| 409 |
} |
| 410 |
|
| 411 |
if (!someNeedIncrease) |
| 412 |
return; |
| 413 |
|
| 414 |
|
| 415 |
for (int i = 0; i < n; i++){ |
| 416 |
AngleAttr aa = angles[i]; |
| 417 |
float wantedIncrement = aa.minAngle - aa.angle; |
| 418 |
if (wantedIncrement <= 0) |
| 419 |
continue; |
| 420 |
float oldAngle = aa.angle; |
| 421 |
ArcGroup ag1 = arcGroups.get(i); |
| 422 |
ArcGroup ag2 = arcGroups.get(i+1 < n ? i+1 : 0); |
| 423 |
|
| 424 |
|
| 425 |
AngleAttr predAA = angles[i == 0 ? n - 1 : i - 1]; |
| 426 |
AngleAttr nextAA = angles[i >= n - 1 ? 0 : i + 1]; |
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
float deltaPred = predAA.angle - predAA.minAngle; |
| 431 |
float deltaNext = nextAA.angle - nextAA.minAngle; |
| 432 |
|
| 433 |
if (log.isInfoEnabled()) { |
| 434 |
log.info("Angle", aa.angle, |
| 435 |
"between", ag1.getInitialHeading(), |
| 436 |
"and", ag2.getInitialHeading(), |
| 437 |
"minAngle", aa.minAngle, |
| 438 |
"wantedInc", wantedIncrement, |
| 439 |
"deltaPred", deltaPred, |
| 440 |
"deltaNext", deltaNext); |
| 441 |
} |
| 442 |
|
| 443 |
if (deltaNext > 0 && deltaPred > 0) { |
| 444 |
ArcGroup ag0 = null; |
| 445 |
ArcGroup ag3 = null; |
| 446 |
int chooseWhich = 0; |
| 447 |
|
| 448 |
|
| 449 |
|
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
if (chooseWhich == 0) { |
| 457 |
|
| 458 |
|
| 459 |
ag0 = arcGroups.get(i > 0 ? i-1 : n-1); |
| 460 |
ag3 = n == 3 ? ag0 : arcGroups.get(i+2 < n ? i+2 : i+2-n); |
| 461 |
if (ag2.sameWay(ag3)) |
| 462 |
chooseWhich = -1; |
| 463 |
else if (ag1.sameWay(ag0)) |
| 464 |
chooseWhich = +1; |
| 465 |
} |
| 466 |
if (chooseWhich == 0) |
| 467 |
|
| 468 |
chooseWhich = ag1.maxRoadClass - ag2.maxRoadClass; |
| 469 |
if (chooseWhich == 0) { |
| 470 |
|
| 471 |
if (nextAA.straightEnough()) |
| 472 |
chooseWhich = -1; |
| 473 |
else if (predAA.straightEnough()) |
| 474 |
chooseWhich = +1; |
| 475 |
} |
| 476 |
if (chooseWhich == 0) { |
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
if (ag2.sameName(ag3)) |
| 481 |
chooseWhich = -1; |
| 482 |
else if (ag1.sameName(ag0)) |
| 483 |
chooseWhich = +1; |
| 484 |
} |
| 485 |
if (chooseWhich == 0) |
| 486 |
|
| 487 |
chooseWhich = ag1.maxRoadSpeed - ag2.maxRoadSpeed; |
| 488 |
|
| 489 |
if (chooseWhich == 0 ) { |
| 490 |
deltaNext = Math.min(deltaNext, wantedIncrement * deltaNext / (deltaNext + deltaPred)); |
| 491 |
deltaPred = Math.min(deltaPred, wantedIncrement - deltaNext); |
| 492 |
} else if (chooseWhich > 0) { |
| 493 |
if (deltaNext >= wantedIncrement) { |
| 494 |
deltaNext = wantedIncrement; |
| 495 |
deltaPred = 0; |
| 496 |
} else { |
| 497 |
deltaPred = Math.min(deltaPred, wantedIncrement - deltaNext); |
| 498 |
} |
| 499 |
} else { |
| 500 |
if (deltaPred >= wantedIncrement) { |
| 501 |
deltaPred = wantedIncrement; |
| 502 |
deltaNext = 0; |
| 503 |
} else { |
| 504 |
deltaNext = Math.min(deltaNext, wantedIncrement - deltaPred); |
| 505 |
} |
| 506 |
} |
| 507 |
} else if (deltaNext > 0) { |
| 508 |
if (deltaNext > wantedIncrement) |
| 509 |
deltaNext = wantedIncrement; |
| 510 |
} else { |
| 511 |
if (deltaPred > wantedIncrement) |
| 512 |
deltaPred = wantedIncrement; |
| 513 |
} |
| 514 |
|
| 515 |
if (deltaNext > 0) { |
| 516 |
log.info("increasing arc with heading", getCompassBearing(ag2.getInitialHeading()), "by", deltaNext); |
| 517 |
ag2.modInitialHeading(deltaNext); |
| 518 |
aa.angle += deltaNext; |
| 519 |
nextAA.angle -= deltaNext; |
| 520 |
wantedIncrement -= deltaNext; |
| 521 |
} |
| 522 |
if (deltaPred > 0) { |
| 523 |
log.info("decreasing arc with heading", getCompassBearing(ag1.getInitialHeading()), "by", deltaPred); |
| 524 |
ag1.modInitialHeading(-deltaPred); |
| 525 |
aa.angle += deltaPred; |
| 526 |
predAA.angle -= deltaPred; |
| 527 |
wantedIncrement -= deltaPred; |
| 528 |
} |
| 529 |
|
| 530 |
if (wantedIncrement > 0) { |
| 531 |
node.setUseCompactDirs(false); |
| 532 |
if (aa.angle == oldAngle) |
| 533 |
log.info("don't know how to fix it", wantedIncrement); |
| 534 |
else |
| 535 |
log.info("don't know how to enlarge it further", wantedIncrement); |
| 536 |
} |
| 537 |
} |
| 538 |
|
| 539 |
} |
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
|
| 544 |
|
| 545 |
|
| 546 |
|
| 547 |
|
| 548 |
|
| 549 |
|
| 550 |
|
| 551 |
|
| 552 |
private static void doSimpleJoin(RouteNode node, List<RouteArc> arcs) { |
| 553 |
RouteArc arc1 = arcs.get(0); |
| 554 |
RouteArc arc2 = arcs.get(1); |
| 555 |
float angle = arc1.getInitialHeading() - arc2.getInitialHeading(); |
| 556 |
float extra = 0; |
| 557 |
if (angle > 360 - SHARP_DEGREES) |
| 558 |
extra = 360 - angle - SHARP_DEGREES; |
| 559 |
else if (angle < SHARP_DEGREES - 360) |
| 560 |
extra = SHARP_DEGREES - angle - 360; |
| 561 |
else if (angle > 0) { |
| 562 |
if (angle < SHARP_DEGREES) |
| 563 |
extra = SHARP_DEGREES - angle; |
| 564 |
} else if (angle < 0) { |
| 565 |
if (angle > -SHARP_DEGREES) |
| 566 |
extra = -angle - SHARP_DEGREES; |
| 567 |
} |
| 568 |
if (extra != 0) { |
| 569 |
if (log.isInfoEnabled()) |
| 570 |
log.info("join angle", angle, "° at", node.getCoord(), "increased by", extra); |
| 571 |
arc1.modInitialHeading(+extra/2); |
| 572 |
arc2.modInitialHeading(-extra/2); |
| 573 |
} |
| 574 |
} |
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
|
| 579 |
|
| 580 |
private static String getCompassBearing (float bearing){ |
| 581 |
float cb = (bearing + 360) % 360; |
| 582 |
return Math.round(cb) + "°"; |
| 583 |
} |
| 584 |
|
| 585 |
} |