gravy | A WebGL simulation of gravitational lensing | Animation library

 by   portsmouth JavaScript Version: Current License: MIT

kandi X-RAY | gravy Summary

kandi X-RAY | gravy Summary

gravy is a JavaScript library typically used in User Interface, Animation, WebGL applications. gravy has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Click below for live demos, and author your own via the API. In the presence of a sufficiently strong gravitational field (produced by large amounts of matter, e.g. stars, galaxies, and dark matter), space is curved and causes light rays to be deflected towards matter. This produces a focusing effect which is known as gravitational lensing, where luminous objects behind a distribution of mass appear to be distorted. Gravy simulates this effect, in order to show the paths which the light follows. A large number of simulated rays are emitted from a light source, and the curved path of each drawn. When enough paths have been drawn, the resulting image converges to a visualization of the amount of light energy everywhere in space in the steady state. There is a single light source, a disk with a variable beam angle, directed along the negative x-axis. The mass distribution is specified in the form of the 3d gravitational potential, via GLSL code. The simulation makes the assumption that the gravitational field is not so strong that the full effects of general relativity need to be taken into account. In this approximation, the effect is exactly analogous to refraction, with the refractive index of space driven by the local gravitational potential. The approximation breaks down sufficiently close to large masses however. In fact in classic lensing systems in astronomy (galactic lensing or microlensing) the angular deflection is actually very small, on the order of arcminutes at most. (Also, there are cosmological effects involved because the distances are so large). In the examples shown here, the lensing is much stronger, producing large angular deflections, even causing the light to bend into loops. This would only happen in reality if the light source is positioned close to a massive compact object like a black hole or neutron star. Strictly speaking a full general relativistic simulation is needed in this scenario, but the simulation can at least be considered a first order approximation. Note also that technically, there should be factors of the gravitational constant and the speed of light involved (e.g. the potential has units of speed of light squared). These constants have been effectively set to 1, so the lengths are in units related to the Schwarzschild radius of the system. As Gravy is not intended to be a fully scientifically accurate simulation, this seems a reasonable approach. There is an experimental system for visualizing with color bands the "time delay" along each light path. In this effect, the total time each light ray takes to travel from source to observer is different, both due to the curving of the path, and also due to time dilation (the so-called Shapiro delay).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              gravy has a low active ecosystem.
              It has 105 star(s) with 5 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              gravy has no issues reported. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of gravy is current.

            kandi-Quality Quality

              gravy has 0 bugs and 0 code smells.

            kandi-Security Security

              gravy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              gravy code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              gravy is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              gravy releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              gravy saves you 362 person hours of effort in developing the same functionality from scratch.
              It has 865 lines of code, 0 functions and 203 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gravy
            Get all kandi verified functions for this library.

            gravy Key Features

            No Key Features are available at this moment for gravy.

            gravy Examples and Code Snippets

            No Code Snippets are available at this moment for gravy.

            Community Discussions

            QUESTION

            Regex with first cap char + digits
            Asked 2021-May-11 at 14:57

            I hit a wall with this one so looking for help.

            My strings must be in the following format:

            ...

            ANSWER

            Answered 2021-May-11 at 14:57

            QUESTION

            How to Iterate through nested json object array
            Asked 2021-May-10 at 07:25

            I am very new to Json parsing. I have to iterate throught json array object.

            my JSON class:

            ...

            ANSWER

            Answered 2021-May-10 at 07:25

            This is what I meant by iterating over the length of the lists, I have added a code from where you can get an idea of how you can parse.

            UPDATED CODE

            Source https://stackoverflow.com/questions/67454939

            QUESTION

            WooCommerce additional fees based on purchased quantity for specific products
            Asked 2021-Feb-12 at 15:15

            Here is the code I currently have:

            ...

            ANSWER

            Answered 2021-Feb-12 at 15:15

            There are some mistakes in your code, try the following instead:

            Source https://stackoverflow.com/questions/66163274

            QUESTION

            Stubborn Ampersand with Invoke-Webrequest SQL & Powershell
            Asked 2020-Dec-17 at 03:39

            When I run powershell using invoke-webrequest on a URL without an ampersand everything works.

            But my URL's have ampersands in them. If I surround them by double quotes it works from PowerShell, but not if I am doing it through my SQL Server.

            Trying to get the right combination of escape characters is proving to be a pain in the butt. Here's an example of the command:

            ...

            ANSWER

            Answered 2020-Dec-16 at 20:34

            Add embedded "..."-quoting to the URL, which requires escaping as \"...\":

            Source https://stackoverflow.com/questions/65330527

            QUESTION

            Declaring intersecting types in Typescript?
            Asked 2020-Sep-16 at 13:19

            I've started learning typescript from the official documentation, and came across the topic of intersecting types. So, in order to get a proper understanding of how type intersection works, i decided to write up a custom type. The FoodItems interface requires to be an array of objects and same for side. However, whenever I try intersect the two types, every representation of FoodOrder fails. I don't understand why that happens and what i'm doing wrong.

            ...

            ANSWER

            Answered 2020-Sep-16 at 13:19

            An intersection type requires food to be both a valid FoodItems object and a valid FoodSide object.

            Remember: an intersection type I = A & B means that the set of values of type I is the intersection of the sets of the values of types A and B. Since every value of type I is at the same time a valid A and a valid B, it follows that the properties of the intersection type I must be the union of the properties of the types A and B.

            Likewise, a union type U = A | B means that the set of values of type U is the union of the sets of the values of types A and B. Since every value of type U is either a valid A or a valid B, it follows that the properties of the union type U must be the intersection of the properties of the types A and B.

            So, what you are saying is that FoodOrder is a type which can be indexed by a number and it returns a FoodItems but at the same time it also returns a FoodSide when it is indexed by a number.

            A value of such a type cannot exist, so you actually can't construct anything that would be legal to assign to food.

            What would be possible is something like this:

            Source https://stackoverflow.com/questions/63920618

            QUESTION

            PS: Define multiple variables in File1, read File2, and replace all tags in File1 with the variables in File2
            Asked 2020-Sep-04 at 23:41

            I have a file1 with several variables defined:

            ...

            ANSWER

            Answered 2020-Sep-04 at 21:16

            You can do the following:

            Source https://stackoverflow.com/questions/63747650

            QUESTION

            R function to start new line every n words?
            Asked 2020-May-13 at 13:04

            I want to create an R function that inserts a "\n" after every n words in a string (where n is an argument).

            e.g.

            ...

            ANSWER

            Answered 2020-May-13 at 13:04

            You can use gsub to create an R function that inserts a "\n" after every n words, where n is an argument.

            Source https://stackoverflow.com/questions/61773284

            QUESTION

            Use json to populate a case switch statement in React
            Asked 2020-Apr-09 at 15:52

            I have the following switch/case statement which returns data from the json object below. In reality this will be very long!

            Switch statement

            ...

            ANSWER

            Answered 2020-Apr-09 at 15:52

            Is this what you need?

            Source https://stackoverflow.com/questions/61124913

            QUESTION

            React.forwardRef is already possible without it, so what's the use of it?
            Asked 2020-Apr-01 at 00:40

            I'm confused on the point of React.forwardRef. As explained in its documentation, I understand that its main use is for a parent to gain access to DOM elements of the child. But I can already do that without even having to use it.

            Here is a code example that you can plug into codeSandbox and see that it works:

            ...

            ANSWER

            Answered 2020-Mar-31 at 23:57

            You're absolutely right that you can do what you've described. The downside is that you're forced to expose an API (ie: the fRef prop) for it to work. Not a huge deal if you're a solo developer building an app, but it can be more problematic eg. if you're maintaining an open-source library with a public API.

            In that case, consumers of the library won't have access to the internals of a component, meaning you'd have to expose it for them somehow. You could simply do what you're suggesting in your example and add a named prop. In fact, that's what libraries did before React 16.3. Not a huge deal, but you'd have to document it so people know how to use it. Ideally, you'd also want some kind of standard that everyone used so it wasn't confusing (many libraries used the innerRef naming convention), but there'd have to be some consensus around that. So all doable, but perhaps not the ideal solution.

            Using forwardRef, passing a ref to a component just works as expected. The ref prop is already standardized in React, so you don't need to go look at docs to figure out how to pass the ref down or how it works. However, the approach you describe is totally fine and if it meets your needs, by all means go with that.

            Source https://stackoverflow.com/questions/60961526

            QUESTION

            Create a Dataframe from list of lists
            Asked 2020-Mar-10 at 21:23

            I have two list of lists which looks like the following

            ...

            ANSWER

            Answered 2020-Mar-10 at 21:23

            You can try , notice I am adding groupby and head due to your ingre_list have duplicated item within each sub-list, if in real data there is no duplicates , you can remove .groupby(level=0).head(1)

            Source https://stackoverflow.com/questions/60625933

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install gravy

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/portsmouth/gravy.git

          • CLI

            gh repo clone portsmouth/gravy

          • sshUrl

            git@github.com:portsmouth/gravy.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link