-
Notifications
You must be signed in to change notification settings - Fork 57
$.linespace()
If you come from Python 🐍, and that you know numpy
, you're probably thinking 🤔 that the Math / array manipulation group of functions are comming from Python 🐍. And you're right because I love ❤️ Python 🐍 and I think it's an amazing 😉 language. That's why I'm importing some concpers from Python 🐍 because they're useful.
But that's not the point. This function is made to create a list of value with the same interval between two value that you choose (it will return evenly spaced numbers over a specified interval). So if you want to create ten values between 0 and e, you'll use the $.linespace()
function. That's what it will return:
[ 0,
0.27182818285,
0.5436563657,
0.81548454855,
1.0873127314,
1.35914091425,
1.6309690971,
1.90279727995,
2.1746254628,
2.44645364565,
2.7182818285 ]
Well, it pretty simple. This function will only require 3 arguments:
-
start
, the smallest value -
end
, the largest value -
n
, the number of value between thestart
and theend
values.⚠️ If you're dealing with float numbers, use.
instead of,
.
Let's say you want to have the result that I showed you before (10 value between 0 and e):
JS:
$.linespace(0, Math.E, 10) // simple as that 😊
Don't hesitate to ask your questions
- Home
- The Core Languages
- Getting Started: Installation
- The Basics (
$.var()
+$.target()
) - Developing for DisplayJS
-
$.select()
- Text related
- If...else
$.xss()
$.repeat()
$.custom()
$.live()
$.load()
$.on()
$.onEvent()
$.ready()
- Scroll API
$.all()
$.clone()
$.is()
$.valEmpty()
$.remove()
$.show()
&$.hide()
$.ajax()
- Class Related
$.css()
$.getStyle()
- Fade effects
$.extend()
$.dynamic()
$.parent()
- Elements-Nodes
$.component()
$.time_ago()
$.copy()
$.then()
$.sleep()
$.getProp()