Giter Site home page Giter Site logo

three's People

Contributors

50wliu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.

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.

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.

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.

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.

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.

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.

Negative (without "fix"):
negative-without-fix

Negative (with "fix"):
negative-with-fix

Positive:
positive

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.

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.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.