Fix arc builder
This commit is contained in:
parent
8e143eb81c
commit
890a1bceca
@ -10,7 +10,7 @@ val ktorVersion by extra("2.0.3")
|
||||
|
||||
allprojects {
|
||||
group = "center.sciprog"
|
||||
version = "0.1.0-dev-2"
|
||||
version = "0.1.0-dev-3"
|
||||
}
|
||||
|
||||
ksciencePublish{
|
||||
|
@ -23,6 +23,7 @@ import java.nio.file.Path
|
||||
import kotlin.math.PI
|
||||
import kotlin.random.Random
|
||||
import center.sciprog.maps.coordinates.kilometers
|
||||
import center.sciprog.maps.coordinates.radians
|
||||
|
||||
private fun GeodeticMapCoordinates.toShortString(): String =
|
||||
"${(latitude.degrees.value).toString().take(6)}:${(longitude.degrees.value).toString().take(6)}"
|
||||
@ -91,7 +92,7 @@ fun App() {
|
||||
drawLine(start = Offset(-10f, 10f), end = Offset(10f, -10f), color = Color.Red)
|
||||
}
|
||||
|
||||
arc(pointOne, 10.0.kilometers, 0f, PI)
|
||||
arc(pointOne, 10.0.kilometers, 0f.radians, PI.radians)
|
||||
|
||||
line(pointOne, pointTwo, id = "line")
|
||||
text(pointOne, "Home", font = { size = 32f })
|
||||
|
@ -146,8 +146,8 @@ public fun MapFeatureBuilder.arc(
|
||||
public fun MapFeatureBuilder.arc(
|
||||
center: Pair<Double, Double>,
|
||||
radius: Distance,
|
||||
startAngle: Number,
|
||||
endAngle: Number,
|
||||
startAngle: Angle,
|
||||
endAngle: Angle,
|
||||
zoomRange: IntRange = defaultZoomRange,
|
||||
color: Color = Color.Red,
|
||||
id: FeatureId? = null,
|
||||
@ -155,8 +155,8 @@ public fun MapFeatureBuilder.arc(
|
||||
id,
|
||||
MapArcFeature(
|
||||
GmcRectangle.square(center.toCoordinates(), radius, radius),
|
||||
startAngle.degrees,
|
||||
endAngle.degrees,
|
||||
startAngle,
|
||||
endAngle,
|
||||
zoomRange,
|
||||
color
|
||||
)
|
||||
|
@ -20,6 +20,7 @@ internal class DistanceTest {
|
||||
val distance = curve.distance
|
||||
|
||||
assertEquals(632.035426877, distance.kilometers, 0.0001)
|
||||
assertEquals((-0.6947937116552751).radians, curve.forward.bearing)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
Reference in New Issue
Block a user