34 votes

How to estimate geodesics on discrete surfaces?

Geodesics in Heat Algorithm At the suggestion of @user21 I am splitting up my answers to help make the code(s) for calculating geodesics distances easier to find for other people interested in these ...
user avatar
  • 3,564
32 votes
Accepted

How to speed up estimation of Mean and Gaussian curvatures on triangular meshes?

Note added 1/29/2020: the routines here have a bug where the mean curvature is sometimes computed with the opposite sign. I still need to work on how to fix this. I guess I should not have been ...
user avatar
24 votes

Computing Gaussian curvature

Definition ...
user avatar
  • 34.6k
22 votes
Accepted

Geodesics on a torus

I don't know if there's a simple way to find geodesics on a torus, but I can give you a general way to find geodesics on any curved surface. First, I define the torus: ...
user avatar
  • 35.5k
22 votes
Accepted

How to estimate geodesics on discrete surfaces?

Nothing really new from my side. But since I really like the heat method and because the authors of the Geodesics-in-Heat paper are good friends of mine (Max Wardetzky is even my doctor father), here ...
user avatar
21 votes

How to speed up estimation of Mean and Gaussian curvatures on triangular meshes?

It took me a while, but the suggestion of @Michael E2 was quite helpful, and especially the post (Optimize inner loops). For those of you (like me) who are new to this style of programming in ...
user avatar
  • 3,564
20 votes

The time-like geodesics (orbits) in the Schwarzschild spacetime

Studying basic solutions at the theoretical physics it is advantageous when one can get an exact solution. At the first sight one can see that the solution can be given in terms of elliptic functions ...
user avatar
  • 54.1k
17 votes

How to estimate geodesics on discrete surfaces?

Here is an exact algorithm but heavier to implement and to optimise. I chose to implement the "Line of Sight Algorithm" from Balasubramanian, Polimeni and Schwartz (REF). Exact Line of Sight ...
user avatar
  • 3,564
15 votes
Accepted

How to find the magnitude of a vector?

Norm in general assumes complex arguments and uses Abs to provide for that: Norm[{x, y}] Sqrt[Abs[x]^2 + Abs[y]^2] For ...
user avatar
  • 14.9k
14 votes
Accepted

Solving the Frenet Serret equations for non-constant curvature and torsion, obtaining parametric equations

Okay, this'll be a short answer just to show what you can do. What you are trying for here is essentially an inverse to FrenetSerretSystem, which will give the ...
user avatar
  • 63.2k
14 votes
Accepted

Can Mathematica solve nonlinear, coupled differential equations?

There were syntactic and conceptual problems with your formulation. Conceptually, NDSolve is a numerical solver, so you need to specify boundary conditions as ...
user avatar
  • 60.1k
13 votes
Accepted

How does a Pringle lose its curvature?

You need to delay the evaluation of the right-hand side of ScalarCurvature: ...
user avatar
  • 5,438
12 votes
Accepted

Computing Gaussian curvature

Note this parametric surface of unit sphere (S^2) should have constant Gaussian curvature: 1. Surface: x[u_, v_] := {Cos[u] Cos[v], Cos[u] Sin[v], Sin[u]} ...
user avatar
  • 55.1k
11 votes
Accepted

RegionNearest and neighborhoods

If you don't mind using undocumented stuff, you can access lots of useful properties by converting the BoundaryMeshRegion to a ...
user avatar
  • 83.3k
11 votes
Accepted

Estimating Principal Curvature Directions on Discrete Surfaces

For this answer, I shall be doing something slightly more ambitious. In particular, I will be computing the so-called curvature tensor, which encodes information on the normal vector $\mathbf n$, the ...
user avatar
11 votes
Accepted

Plot a space curve and its curvature

ArcCurvature is already built-in to Mathematica, so there is no need to compute curvature manually: ...
user avatar
11 votes
Accepted

Visualization of Gaussian Curvature

I finally got around to fixing the routine in the math.SE answer the OP linked to. To make this answer self-contained, I'll reproduce the definitions here: ...
user avatar
11 votes

How to calculate scalar curvature, Ricci tensor and Christoffel symbols in Mathematica?

Since Version 9, functions to do this have been built into Mathematica but not documented. They live in the SymbolicTensors package which underlies ...
user avatar
  • 13.4k
11 votes

How to estimate geodesics on discrete surfaces?

IGraph/M's IGMeshGraph function makes it easy to implement the graph-based solution. This function constructs a graph in which vertices correspond to mesh vertices ...
user avatar
  • 225k
10 votes
Accepted

Expand wedge product

One idea is to use TensorReduce. I will assume that r is real, and that Dt[r] and ...
user avatar
  • 124k
10 votes

Prove $R^\top R = I_3$ and find skew-symmetric matrix $R^\top \dot R$

My method of solving this in a manner, that does not require loads of computation and with an acceptable number of terms is using a little bit of tensor algebra. The fundamental steps are: Express $R,...
user avatar
  • 1,005
9 votes
Accepted

reconstruct a 3D curve from discrete curvature and torsion

The curvature and torsion are rates of turning of the Frenet-Serret frame and can be used to integrate the frame using an Euler-type method. The unit tangent vector of the frame is the velocity and ...
user avatar
  • 216k
9 votes

Archimedean spiral from curvature

Ok, thanks to მამუკა ჯიბლაძე I got the following solution: ...
user avatar
9 votes
Accepted

It seems Eigensystem[m] returns vectors that are not eigenvectors

Classical problem. You want to compute the eigensystem of the second fundamental form with respect to the first fundamental form. Thus you have to solve a generalized eigensystem. This can be done ...
user avatar
9 votes

Coordinate-free derivative

A solution using FeynCalc would be to write ex = CVD[v, i]/Sqrt[CSPD[v, v]] which corresponds to $ \frac{v^i}{\sqrt{v^2}} $ (CVD...
user avatar
  • 3,312
9 votes

Coordinate-free derivative

Maybe you could use the following approach: ...
user avatar
  • 124k
9 votes
Accepted

Finding unit tangent, normal, and binormal vectors for interpolated function

First we get you interpolating function: ...
user avatar
  • 24.8k
8 votes

Estimating Principal Curvature Directions on Discrete Surfaces

OK, at least here is an attempt to solve my problem. Hopefully these thoughts and code may be useful to others. It seems like there is no single ideal algorithm to solve this problem. Some work ...
user avatar
  • 3,564
8 votes

How to estimate geodesics on discrete surfaces?

Graph Based Algorithm (Dijkstra) One algorithm that already gives an approximation to the shortest path (which approximates a geodesic), is the algorithm already implemented in Mathematica for ...
user avatar
  • 3,564
8 votes

Trying to plot a wormhole; getting bad results

Providing your math is correct, I see two problems: You need to do the revolution with a single slice through your surface ...
user avatar
  • 106k

Only top scored, non community-wiki answers of a minimum length are eligible