at-import / sassy-math Goto Github PK
View Code? Open in Web Editor NEWComplex math functions for Sass
Complex math functions for Sass
Thinking about creating an organization for stuff like this so we all can take more equal ownership. Either that or move to @thesassway.
Exponents only work for whole numbers and need to be revised for non integers
In the readme.md
and in the sassy-math.rb
files, the inverse trigonometric functions, the hyperbolic functions and their inverses take in an argument called $radians
or rad
. That's a bit misleading.
The inverse trigonometric functions actually take in a number value (restricted to the interval [-1, 1]
in the case of sin
and cos
) and output an angle value in radians. It's precisely the inverse of the direct trigonometric functions, which take in an angle value in radians and return a number (which is a number between -1 and 1 for sin
and cos
).
The hyperbolic functions are just that, hyperbolic functions. They're not trigonometric functions and they don't fall under trigonometry, but under hyperbolic geometry. Their name is just an analogy. Just like when plotting the points (sin(a), cos(a))
, the result is the unit circle (which is why the trigonometric functions are also called circular functions), when plotting the points (sinh(a), cosh(a))
, the result is the unit hyperbola.
Calling the argument for such a function $radians
or rad
doesn't make much sense, since the radian is a unit of angular measure. Both the hyperbolic functions and their inverses take in a number value and return a number value as well (with the domain restrictions corresponding to each).
Still trying to find a complete formula, a lot of the ones I am coming across are simplified or use circular logic. Combining simplified versions should point us in the right direction.
Use an algorithm to compute roots instead of feedback loops. It will be more verbose but less processor intensive and faster.
http://en.wikipedia.org/wiki/Methods_of_computing_square_roots
Sam,
I am playing around with building a test suite for this stuff as I dive in but am having trouble getting the ruby working. Are you building a gem after each change to test? Seems like there should be a better way.
Attached is my work, hoping to tackle random numbers and stuff to get back into this:
scottkellum/sassy-math@f7c3654
Planning on rolling this stuff into modular scale, and this project into Compass.
What are people's thoughts on moving from a "push straight to master" model to a "branch and issue pull request" model? This would help with us stepping on each other's toes and make it easier to keep track of discrete pieces to be worked on.
Thoughts?
Hi, is it possible to add this function to sassy-math?
Turn into Compass Plugin.
NOTE — Compass has trig functions built in so leveraging that in the compass-specific build: http://compass-style.org/reference/compass/helpers/trig/
exponent(20, $pi) will crash...
hi,
is it possible to use a prefix for functions in order to avoid conflicts with other frameworks?
thanks!
Ready to make this public soon? Lets just clean this up and switch it to SCSS only. Mark as beta and add the licence.
The basics are there, but it seems like we need more eyes on this to polish up rough areas.
Would anyone be opposed to me converting this to SCSS? For me, with lots of nested if/else and for loops, SCSS is a lot easier to keep track of everything.
Compass is a huge dependency on a project…is there any way to make Sassy-math independent?
Get ln to work for a full range of numbers.
Hi, in your readme file you mention being able to us
exponent($base, $power_numerator, $power_denominator)
However this function only accepts two arguments. Have I misunderstand the meaning here?
Would be nice so we can use it on, say, Metalsmith projects.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.