Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/lerpPublic

Simple linear interpolation function for Kotlin

License

NotificationsYou must be signed in to change notification settings

datkt/lerp

Repository files navigation

Simple linear interpolation function for Kotlin

Installation

$ npm install @datkt/lerp

Usage

$ konanc -r node_modules/@datkt/lerp -l lerp index.kt$ ./program.kexe
importdatkt.lerp.*funmain(args:Array<String>) {val x= toDouble(0, args,0.123)val y= toDouble(1, args,0.456)val t= toDouble(2, args,0.5)println("lerp(${x},${y},${t})=${lerp(x, y, t)}")}funtoDouble(i:Int,args:Array<String>,default:Double):Double {val n=if (args.size> i+1) args[i]elsenullif (null!= n&& n.length>0) {return n.toDouble()  }return default}

API

val z = lerp(x: Double, y: Double, t: Double): Double

Compute the linear interpolation between two pointsx andy with afactor oft.

val z= lerp(1.0,2.0,1.0)// z=2.0

License

MIT

About

Simple linear interpolation function for Kotlin

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp