MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / easeInOutCubic

Function easeInOutCubic

internal/ui/program.go:237–249  ·  view source on GitHub ↗

easeInOutCubic maps t ∈ [0,1] to [0,1] with a smooth-start/smooth-end shape: slow entrance, fast middle, slow exit. The classic curve for "object passing through" motion.

(t float64)

Source from the content-addressed store, hash-verified

235// shape: slow entrance, fast middle, slow exit. The classic curve for
236// "object passing through" motion.
237func easeInOutCubic(t float64) float64 {
238 if t < 0 {
239 return 0
240 }
241 if t > 1 {
242 return 1
243 }
244 if t < 0.5 {
245 return 4 * t * t * t
246 }
247 p := 2*t - 2
248 return 0.5*p*p*p + 1
249}
250
251func (m harness) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
252 switch msg := msg.(type) {

Callers 1

UpdateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected