aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Num.mix.3
blob: 01e5d7dd13fe0333bb9b433948446e79389c44cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Num.mix 3 2025-11-29 "Tomo man-pages"
.SH NAME
Num.mix \- mix two numbers by an amount
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Num.mix\ :\ func(amount:\ Num,\ x:\ Num,\ y:\ Num\ ->\ Num)
.fi
.SH DESCRIPTION
Interpolates between two numbers based on a given amount.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
amount	Num	The interpolation factor (between \fB0\fR and \fB1\fR). 	-
x	Num	The starting number. 	-
y	Num	The ending number. 	-
.TE
.SH RETURN
The interpolated number between `x` and `y` based on `amount`.

.SH EXAMPLES
.EX
assert (0.5).mix(10, 20) == 15
assert (0.25).mix(10, 20) == 12.5
.EE
.SH SEE ALSO
.BR Tomo-Num (3)