-
-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement solid angle measure for two-dimensional cones #33752
Comments
comment:1
The only non-simplicial cones in 2d are the non-pointed cones, i.e., cones that contain a nontrivial subspace. So the answer is either 0, 1/2, or 1; no triangulation is needed. |
This comment has been minimized.
This comment has been minimized.
comment:4
Merged in #33656. |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:8
When |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
Best not to use the general symbolics facility ( |
comment:15
Functions that looks like this:
... are best rewritten as generators. https://realpython.com/introduction-to-python-generators/#understanding-generators |
comment:16
This decomposition looks correct, but I don't think this is the best way of computing the solid angle - as I explained in comment:1. |
comment:17
All of this can be replaced by just using |
comment:18
When using
Replying to @mkoeppe:
|
comment:19
If you only need algebraic numbers, you can use |
comment:20
Right, if the input is of type AA, then Polyhedron can deal with it, and the output is also of type AA. The question is, what if the input is just
|
comment:21
Replying to @yuan-zhou:
Well, you can try to convert it to a matrix space over
Do you have an application for non-algebraic irrational input? If yes, then yes, one would have to either avoid Polyhedron or extend Polyhedron so it can handle well-behaved symbolic elements. After all, this error:
is artificial - it's there to protect users from weird stuff that can happen. If no, then maybe this generality is not worth working on? |
comment:22
You are right, I don't have an application where the input is non-algebraic irrationals. I agree that symbolics facility ( However, I thought that checking the special cases of half space and whole space is straightforward enough, which make the use of Polyhedron and the conversion to AA seem overkill. It's just some if else statements, and with that, the input Also, if we convert the inputs matrix to over AA, what would be the right type of the output? Do we always have AA as output type, never the Symbolic ring or Symbolic Constants Subring? |
comment:23
Replying to @yuan-zhou:
Yes, it would make sense to convert it back to the ring where it came from if AA is used internally. (That's how we do this for the |
comment:25
Do you mean to use Replying to @mkoeppe:
|
comment:26
First check if |
comment:27
Sure, using Replying to @mkoeppe:
|
comment:28
Your code would still work without normaliz for rational input. |
comment:29
Yes, that's right. As it's quite usual to have sqrt(2), sqrt(3) in rays (45°, 60°), I think the code should work for these cases regardless of having normaliz or not. Replying to @mkoeppe:
|
comment:30
I think some more thought on the use cases is needed. Where do your irrational inputs come from? If you already have angles, there's no need to recompute them |
comment:31
Replying to @yuan-zhou:
I mean I know that it can deal with |
comment:32
I don't really have use cases in 2D, 2D angles are trivial... It feels weird that if a Calculus student wants to compute the angle between ray (1, 0) and ray (0, sqrt(3)), they must have normaliz installed. My thought is not to use Polyhedron in 2d, but just check for the two special cases. Alternatively, we can use |
comment:33
Replying to @yuan-zhou:
You're missing that the conversion code that is in our Normaliz backend does not need Normaliz. We are using it to communicate with Normaliz. |
comment:34
I know that "conversion code that is in our Normaliz backend does not need Normaliz."
|
comment:35
See #34479 |
comment:36
I agree with #34479. That ticket will become more useful when we write code for solid angle computation in higher dimension. In 2d, it is like shooting butterfly with rifles :P, but why not... |
Implement the solid angle measure (the plane angle) of a two-dimensional cone, using the dot-product (trigonometry) formula.
We do not assume nor compute the minimal description of the cone.
When the input contains more than two vectors as generators of the cone, we decompose the cone into simplicial cones. The helper function
simplicial_subcones_decomposition
will be re-used in higher dimension cases.For example, the solid angle of the upper half plane (generated by three rays, hence not simplicial)
solid_angle_2d([[1,0],[0,1],[-1,0]])
is 1/2.Depends on #33656
CC: @yuan-zhou @mkoeppe
Component: geometry
Keywords: solid angle
Author: Allison Fitisone, Yuan Zhou
Branch/Commit: u/gh-allisonfitisone/implement_solid_angle_measure_for_two_dimensional_cones @
7a7c253
Issue created by migration from https://trac.sagemath.org/ticket/33752
The text was updated successfully, but these errors were encountered: