three's People
three's Issues
Unknown function ln
The calculator doesn't recognize when I use the absolute value bars. The reason I'm trying to use them is because the calculator does not handle negatives.
I'm assuming this hasn't been added to the calculator yet and I know it's a work in progress.
Bounds can pass intersection points
For example, let's say we have Math.cos(x)
and x*x
as our two functions. Those functions intersect at approximately 0.82, so it should be impossible for either the first bound to be smaller than a multiple of 0.82 or for the second bound to be larger than that same multiple of 0.82.
Graph of the function still shows up even if the solid is invalid
This happens because func.draw()
happens before func.drawShape()
.
Some solids don't show up
I'll edit the title once I figure out what causes the calculator to break.
For now...Math.sin(x), [blank], -5, -4, 1.3 won't cause any solid to show up.
Solid is incorrect when bound1 is negative
A couple of fun ones to look at:
-x, -4, 0, 4
x, -4, 0, 4
x, -4, 0, 0
x, -4, 0, -4
Faulty check system to see if axisOfRotation>bound2
What we're doing right now is basically boundY2>axisOfRotation
to see if aOR is in between the bounds.
This system breaks when the graph does not linearly go higher (eg cos(x)
). For example, the calculator will attempt to graph Math.cos(x) <blank> 0 Math.PI 0.5
even though 0.5 is clearly below 1, which is cos's max point.
boundY1 == boundY2 case is broken
Just as I expected.
y=3
, y=-x^2
, x=-3
, x=3
, y=4
Move away from eval()
eval
prevents its entire containing function from being optimized, not to mention that pretty much every linter and Javascript guide out there doesn't recommend it.
The plan is to switch everything to math.eval
instead, which despite its name does not seem to call eval
internally. This will also speed up the graphing process even more since it'll allow the addBSP
and addSolidWithoutHoles
functions to be optimized.
This is considerably trickier than the previous switch because the eval'd code contains actual Javascript code and not just math like the equations and bounds.
Passing a constant as the first equation does not work
This is a really critical bug.
y=3, y=-x^2, x=-3, x=3, y=3
works but y=-x^2, y=3, x=-3, x=3, y=3
doesn't and gives WebGL warnings in the console.
Solid of revolution passes the second bound
Due to our quality intervals, the solid of revolution will always go beyond the second bound by a bit if the second bound cannot be cleanly divided by 0.1 for aOR=0 (our smallest interval-'ultra') or 0.5 for BSPs. Some examples include 3.14, 6.28, 0.234234, etc.
Math expressions not allowed
May have been caused by 5a6dad3.
Trying to do Math.*
or even basic mathematical operations (5+3
) in the bounds/rotation fields will throw an error about that field not being valid.
A possible fix for this would be to eval()
the fields first before seeing if they're NaN.
Rotating around y=0 will disregard the second function
Basically, it acts as if the second function doesn't exist.
Incorrect error message when no bounds are specified
If no bounds are specified, drawShape() should not be invoked and just the function should appear so it can double as a normal graphing calculator. Currently it throws the "Bounds cannot be the same" warning.
ln doesn't work
ln(x)
doesn't work and throws an error.
Remove the "hacky bugfix woo"
I have no idea when this gets triggered or how it would.
@saxocellphone Why do you write such bad code ๐
Is it possible to graph a torus using this calculator?
If it's not possible, can you please add this feature?
Allow rotation around the y-axis
Right now, we can only rotate around the x-axis (using the shell method).
Graph is tilted slightly backwards
The graph is tilted slightly backwards when the page first loads.
This is due to us setting camera.position.z
to 5. Sadly, this can't be fixed by just removing that line because then mouse-dragging will stop working (and the graph will flip).
Add examples
It's kinda non-obvious how to graph things right now.
Solid constraints only work for positive functions
On line 320 there's this if statement: if(this.equation1.getCoord(i) <= size)
. It's meant to stop rendering the solid if it goes outside the 28x28 graph size. However this obviously doesn't work for negative functions. A simple fix (such as the one I committed yesterday for a similar bug) would be if(math.abs(this.equation1.getCoord(i)) <= size)
, though after testing that out I realized that this method provides slight inconsistencies. The correct way would be to do something like the bounds over-extending where the size is modified.
Changing graph size
I want the user to be able to change the graph size. I worked on it for like 5 min but then gave up because it wasn't working. I'll work on it more later but not now. You can work on it if you wish
Graph is upside-down
@saxocellphone -.-
Upside-down being that y=5 is interpreted as y=-5, so everything has to have an extra negative in front of it in order for it to appear correctly.
I'll try to fix this though.
y=x^2-2x, y=x, x=0, x=3, y=4 doesn't work
No solid is graphed.
Example was taken from http://tutorial.math.lamar.edu/Classes/CalcI/VolumeWithRings.aspx, so it's definitely valid.
This has been broken since at least fa81734.
Rename project
So...Three is the name of the underlying framework we're using, which really doesn't convey what we're doing here. In addition it can get kinda confusing when both this and the framework share the same name. It was fine when this was just a "private" experiment but I'd like for it to mature more.
I want the new name to be a bit clever or at least be able to stand out, but unfortunately I suck at naming things.
@saxocellphone Thoughts?
Not bounded by y=0
For now, I think the solid of revolution should be bounded by x = 0 and y = 0, and a user set vertical bound. (Didn't get there yet) the x=0 part is working fine, but the solid is not bounded by y=0. For example, if you graph sin(x), you can see it's not bounded by y=0. If I make an if statement to check if the y-coordinate is less than 0, and stop graphing it if y < 0, you can see some serious bug caused by intervals.
Placeholders are cut off
Easy fix, just need to differentiate the classes. I'll do that when I get home.
Rotates around x-axis instead of y-axis
Lighting is a bit off
So because the solid is made up with hundreds of different size cylinder/cones, the lighting is slightly off. If you look near the base of the solid, you can see colors changing dramatically, which ruins the awesome effect. But this is just a minor problem.
Move away from deprecated THREE.LinePieces
THREE.LinePieces
has been deprecated in favor of THREE.LineSegments
for some time now. Unfortunately it seems like the schematics are different in that LinePieces will connect each line separately whereas LineSegments will attempt to connect all of them.
Uncaught error when attempting to rotate functions that don't intersect
Example: -(x + 1), x^2 + 1, -5, -1, 3. This throws an Uncaught TypeError: Too few arguments in function max (expected: Array or Matrix or any, index: 0)
at graph.js:104
when attempting to compute the vertex.
We should warn the user instead.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.