Skip to content

Commit

Permalink
y position of posint fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonAsmirko committed Mar 25, 2021
1 parent 3c033f8 commit f96936e
Show file tree
Hide file tree
Showing 67 changed files with 27 additions and 16 deletions.
Binary file modified .gradle/6.7.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/6.7.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/6.7.1/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/6.7.1/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/6.7.1/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/6.7.1/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file modified .gradle/6.7.1/javaCompile/jarAnalysis.bin
Binary file not shown.
Binary file modified .gradle/6.7.1/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified .gradle/6.7.1/javaCompile/taskHistory.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified build/classes/java/main/firstLab/Optimizer$Pair.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/MainKt$main$1$1$1$1$14$1.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/MainKt$main$1$1$1$1$15$1.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/MainKt$main$1$1$1$2$1.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/MainKt$main$1$1$1$3$1.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/MainKt$main$1$1$1$4$1.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/MainKt$main$1$1$1$5.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/MainKt$main$1$1.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/MainKt$main$1.class
Binary file not shown.
Binary file not shown.
Binary file modified build/classes/kotlin/main/MainKt.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/classes/kotlin/main/composables/PlotComposableKt.class
Binary file not shown.
Binary file modified build/classes/kotlin/main/extensions/CanvasSextensionsKt.class
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/build-history.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
��������������������
�������������������������
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
β ΪΪΪαεηςςςςΜ οηκΓ όαϊ
т ккксхчђђђђЬ ячъУ ќсњи и и Ш Ф
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
�Z�X�V�V�V�U�T�T�T�S�R�Q�U
챘쑖쑖쁖셕핔���화
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
63
50
71
58
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.len
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
έςΙ.α6Γ)Ϋ'Ρ$ΰ'Ο(ά Ϊ$εΣ"γβΛθΗΟοοΩΩάΩχΗΥΚωψθαβφΦχΘΙΕ'π�Α*ψ%ψ$π"χύ"ςΐΔΪοΦαπθΓΡ%ω#ΦχέύυΜΧ%ρϊ$
έςΙ.α6Γ)Ϋ'Ρ$ΰ'Ο(ά Ϊ$εΣ"γβΛθΗΟοοΩΩάΩχΗΥΚωψθαβφΦχΘΙΕ'π�Α*ψ%ψ$π"χύ"ςΐΔΪοΦαπθΓΡ%ω#ΦχέύυΜΧ%ρϊ$Ο,Ω,Η,ΛΚό!άΑ(ά*ΐΪΘ(δ
Expand Down
Binary file modified build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i
Binary file not shown.
Binary file modified build/kotlin/compileKotlin/last-build.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/firstLab/Optimizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static Double toDouble(Object s) {

public static class Pair <T> {
public T first, second;
Pair(T a, T b) {
public Pair(T a, T b) {
this.first = a;
this.second = b;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/composables/PlotComposable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fun plotView(
cursorPosition: Offset?,
cursorDrawingPermitted: Boolean,
themeColors: Colors,
allOptimizersSteps: ArrayList<ArrayList<Optimizer.Pair<Double>>>,
allOptimizersSteps: List<List<Optimizer.Pair<Float>>>,
currentStep: Int
) {
val paint by remember { mutableStateOf(Paint()) }
Expand Down
10 changes: 7 additions & 3 deletions src/main/kotlin/extensions/CanvasSextensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fun Canvas.prepareAxis(
}

fun Canvas.drawStep(
allOptimizersSteps: ArrayList<ArrayList<Optimizer.Pair<Double>>>,
allOptimizersSteps: List<List<Optimizer.Pair<Float>>>,
currentStep: Int,
scaleX: Float,
scaleY: Float,
Expand All @@ -101,11 +101,15 @@ fun Canvas.drawStep(
else -> allOptimizersSteps[currentStep]
}

println("$currentStep ${allOptimizersSteps.size}")

currentPoint.forEach {

println("${it.first} ${it.second}")

val pointToDraw = Offset(
(it.first.toFloat() - lBound) * scaleX,
(it.second.toFloat() - minFnVal) * scaleY
(it.first - lBound) * scaleX,
(it.second - minFnVal) * scaleY
)

drawCircle(pointToDraw, 10f, paint)
Expand Down
17 changes: 12 additions & 5 deletions src/main/kotlin/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -188,21 +188,19 @@ fun main() = Window(
MaterialTheme.colors
) {
functionDrawingPermitted = validateInput(stepSize)
if(functionDrawingPermitted) {
if (functionDrawingPermitted) {
currentOptimizerStep += stepSize.toInt()
}
println(currentOptimizerStep)
}
fieldSpacer()
buttonInBox(
Constants.PREV_ITERATION,
MaterialTheme.colors
) {
functionDrawingPermitted = validateInput(stepSize)
if(functionDrawingPermitted) {
if (functionDrawingPermitted) {
currentOptimizerStep -= stepSize.toInt()
}
println(currentOptimizerStep)
}
}
}
Expand Down Expand Up @@ -257,7 +255,16 @@ fun main() = Window(
cursorPosition,
clickPermitted,
MaterialTheme.colors,
array,
array
.map {
it.map { p ->
val xFlt = p.first.toFloat()
Optimizer.Pair<Float>(
p.first.toFloat(),
functionsButtonsText[func]!!.invoke(xFlt)
)
}
},
currentOptimizerStep
)
} ?: textCentred(
Expand Down

0 comments on commit f96936e

Please sign in to comment.