Recent MathOverflow Questions

sorting polynomials not just based on the degree [on hold]

Math Overflow Recent Questions - Sat, 12/30/2017 - 15:13

if I were to have a list of multiple polynomials and I need to sort the list in ascending order (not just the degree of the polynomial but relatively all the terms of the polynomial)
How can I achieve it
say I have
$$ 3x^2 + x + 4 $$ $$3x^2 + 2x + 4 $$ $$1x^2 + x + 4 $$ $$2x^2 + 2x + 4 $$

Now I want the final list to be
$$1x^2 + x + 4 $$ $$2x^2 + 2x + 4 $$$$3x^2 + x + 4 $$ $$3x^2 + 2x + 4 $$

Elliptic curves: for $P = aG$ for some $a$, what is $Q = a^{-1}G$?

Math Overflow Recent Questions - Sat, 12/30/2017 - 14:54

Given an elliptic curve group with a generator $G$ where $G$ has a prime order, p. Given a point $P=aG$ for some unknown $a$. Is it possible to efficiently calculate $Q=a^{-1}G$ without a discrete log operation?

With a discrete log, the problem is simple: first calculate $a$, then $a^{-1} = a^{p-1} $ mod $p$.

But I can't reduce a diffie-hellman problem to this to break it. Nor do I have the background to prove it directly (I have a background in NP-complete problems).

I see that the possibility of this operations would break a tiny subset of shared secrets but this should be negligible. So unless I'm wrong the existence of this algorithm isn't inconsistent with the original proof.

Indefinite Integral of $ \ln(x)^{\ln(x)^{\ln(x)^{.^{.^{.^{\ln(x)}}}}}}$ for an $ n $-number of $ \ln(x) $'s with respect to $ x $

Math Overflow Recent Questions - Sat, 12/30/2017 - 14:52

This is tetration question about finding the indefinite integral. I am not sure where to start so any help would be appreciated.

$$ I= \int \ln(x)^{\ln(x)^{\ln(x)^{\cdot^{\cdot^{\cdot^{\ln(x)}}}}}} dx $$

MSE was not able to answer so far so I thought this might be more appropriate.(

Linear homogenous polynomials that generates several quadratic polynomials

Math Overflow Recent Questions - Sat, 12/30/2017 - 12:44

This is a generalization of this question.

Let $P_1, \ldots, P_m$, $Q_1, \ldots, Q_k \in \mathbb{C}[x_0,\ldots,x_n]$ be linear homogenous polynomials. Let $f_1, \ldots, f_s$ be a homogenous quadratic irreducible polynomials of degree $2$.

Assume that for every $i$ and for every $j$ the ideal $\langle P_i, Q_j \rangle$ contains some $f_l$.

Assume also that the rank of $\{f_1, \ldots, f_s \}$ (in the vector space of all quadratic homogenous polynomials in $\mathbb{C}[x_0,\ldots,x_n]$) is equal to some constant $c$ .

Question: Is it true that the rank of $\{P_1, \ldots, P_m \}$ or the rank of $\{Q_1, \ldots Q_k \}$ is less than some constant (i.e. some function from $c$)?

I can affirmatively answer this question if $s$ (the number of quadratic polynomials) is bounded by a constant:

Consider those polynomials in $\{f_1, \ldots, f_s\}$ that belongs to $\langle P_1, Q_j \rangle$ for some $j$. W.l.o.g. we can assume that this set is $\{f_1, f_2,, \ldots, f_{s'} \}$ for some $s' \le s$.

Consider $M_i:= f_i \cap P_1$ (I mean the intersection of the zeros $f_i$ and $P_1$) for some $i \le s'$.

This set is the zeros of a quadratic form in plane $P_1$ with codimension $1$ (it can not be $P_1$ since $f$ is irreducible). For some $j$ the intersection $Q_j \cap f$ must contain a subspace of codimension $2$. Hence $M_i$ is the union of one or two subspace of codimension $2$. So, there exists at most $2s'$ subspaces of codimension $2$ such that every $Q_j$ must contain at least one of them. Now, it is not difficult to see that rank of $\{Q_1, \ldots, Q_k\}$ is bounded by $4s' \le 4 s$. The similar argument works for the rank of $\{P_1, \ldots, P_m\}$.

Possible analytical way to solve or approximate a specific optimization problem's solution

Math Overflow Recent Questions - Sat, 12/30/2017 - 11:45

In my research on linear algebra and optimization, I have come across the following problem repeatedly:

Given constant matrices $C\in\mathbb{R}^{k \times k}$ and $X\in\mathbb{R}^{n \times n}$, $$\min_{A\in\mathbb{R}^{n\times k}, B\in\mathbb{R}^{k \times n}} \| X - A C B X \|_F$$

where $C$ may be singular, as $ k \leq n $ ($k,n$ are constant). We minimize the norm over $A, B$ of fixed dimensions (maybe rectangular) with no additional constraints.

If $C$ were absent (replaced with the unit matrix), this could be solved analytically via low-rank matrix approximation ($AB$ can be viewed as the rank factorization of the approximating matrix), but can anyone tell me if an analytical solution is available in the presence of singular/rectangular $C$ matrices? Perhaps good approximations with appropriate bounds on the error? The relation to the problem without $C$?

I am unable to find an analytical solution and a numerical/iterative solution would not be very informative on the role of the $ C $ in the solution for the optimal $A, B$, which is my goal. I thank all helpers and appreciate all assistance.

A question about Pascal triangle [on hold]

Math Overflow Recent Questions - Sat, 12/30/2017 - 10:45

There is a number $n \in \mathbb{N}, \ n > 1, n < 2^k$. How to prove this statement:
$n$ is included into Pascal triangle not more than $2k -2$ times? I have no idea how to solve this.

Question about a result of Anderson

Math Overflow Recent Questions - Sat, 12/30/2017 - 10:44

In "Riemannian Geometry, Peter Petersen, GTM171, Third Edition" page 430, there is an Anderson Lemma: For each $n\geq 2$, there is an $\varepsilon(n)>0$ such that any complete Ricci flat manifold (M,g) that satisfies $$Vol(B(p,r))\geq(1-\varepsilon)\omega_n r^n$$ for some $p\in M$ is isometric to Euclidean space.

I have problem about the proof in this book.

The book proved it by contradiction: for each $i$, it constructed a complete Ricci flat manifold $(M_i,g_i)$, with $\lim\limits_{i\rightarrow \infty}\frac{Vol(B(p_i,r)}{\omega_n r^n}\geq(1-\frac{1}{i})$, and $(M_i,g_i)$ is not isometric to Euclidean space.

But the book said that for all $r>0$, the $C^{1,\alpha}$ harmonic norm of $(M_i,g_i)$ of scale $r$ is nonzero. After scaling the metric suitably, it assumed the $C^{1,\alpha}$ harmonic norm of $(M_i,\bar{g_i})$ less than 1, and the pointed norm has positive lower bound. I think it is impossible, but I do not know how to correct it.

It is true that if $(M_i,g_i)$ is not isometric to Euclidean space, we can find $r_i$, such that the $C^{1,\alpha}$ harmonic norm of $(M_i,g_i)$ of scale $r_i$ is nonzero. But we do not know that it is uniformly bounded.

Remark Crossposted in MSE.

Dixmier-Douady class is the third integral Stiefel-Whitney class

Math Overflow Recent Questions - Sat, 12/30/2017 - 08:10

Let $M$ be (say smooth) manifold. From the short exact sequence of groups $0 \to \mathbb{Z} \to \mathbb{Z} \to \mathbb{Z}_2 \to 0$ (where the first map is multiplication by $2$) one obtain long exact sequence in cohomology. In particular one obtains the connecting map $\beta:H^2(M,\mathbb{Z}_2) \to H^3(M,\mathbb{Z})$. This map is called the Bockstein homomorphism. Define $W_3(M):=\beta(w_2(M))$ where $w_2(M)$ is the second Stiefel-Whitney class. The class $W_3(M)$ is called the third integral Stiefel-Whitney class.
On the other hand there is another class in $H^3(M,\mathbb{Z})$ which at the first sight has nothing to do with $W_3(M)$: it is called Dixmier-Douady class and is defined in terms of bundles of simple $C^*$-algebras.

It turns out that these two classes coincide: this is proved in this paper by Plymen-see Theorem 2.8. However the proof relies on another result. The author gives precise reference:

Marry P. ,,Varietes spinorielles. Geometrie riemannienne en dimension 4'', Seminaire Arthur Besse, CEDIC, Paris 1981

however I was unable to find it (even if I could, unfortunately I don't speak French). So

I would like to understand why $W_3(M)=\delta(M)$, in particular understand the last two lines of the case ''i)'' in the proof of Theorem 2.8 in the above paper.

EDIT: The relevant bundle for defining $\delta(M)$ is the (even part of) the complex Clifford bundle of the tangent bundle. Recall that the complex Clifford algebras are isomorphic to either $M_{2^n}(\mathbb{C})$ or to $M_{2^n}(\mathbb{C}) \oplus M_{2^n}(\mathbb{C})$ thus the even part of Clifford algebra is always a simple algebra.

Underlying structure behind the infamous IMO 1988 Problem 6

Math Overflow Recent Questions - Sat, 12/30/2017 - 06:42, and recently popularised by Numberphile:

Let $a$ and $b$ be positive integers such that $ab + 1$ divides $a^{2} + b^{2}$. Show that $\frac {a^{2} + b^{2}}{ab + 1}$ is the square of an integer.

The elementary proof is well known and based on infinite descent using Vieta jumping (

My question is:

What are non-elementary ways of solving it? Which mathematical structure is useful in creating the context for this problem? Is there an insight of the type where, once the problem is put into the right algebraic context, the solution is obvious*?

*What I have in mind is: notice, for example, how most of the steps in Euler's proof of the Fermat's prime sum of squares theorem ( become trivial once re-interpreted in the ring $\mathbb Z [i] $, the infinite descent itself being replaced by Euclidean division. Is something similar applicable here?

Norm of solution of quadratic program

Math Overflow Recent Questions - Sat, 12/30/2017 - 06:41

In a quadratic program (QP), do linear equality constraints always reduce the norm of the minimizer? Specifically, let $P \succ 0$, $A \in \mathsf{M}_{m\times n}$ and $q\in\mathbb{R}^n$. Define

$$x^* := \arg\min_x\,\tfrac{1}{2} x^\mathsf{T} P x - q^\mathsf{T}x$$


\begin{align} x_c^* &:= \arg\min_x \, \tfrac{1}{2} x^\mathsf{T} P x - q^\mathsf{T}x\\ &\quad\,\,\,\operatorname{subject to} \,\,Ax=0. \end{align}

Intuitively $\|x_c^*\| \leq \|x^*\|$, if not in the standard $\ell^2$ norm in the $P$ (or maybe $P^{-1}$) induced norm $\|x\|_P = \langle Px,x \rangle^{1/2}$, because I'd think that the solution $x_c^*$ is the $\|\cdot\|_P$ metric projection of $x^*$ onto $\ker A$, a closed convex set, and such a projection is a contraction.

Nevertheless, I'm having trouble showing this. Boyd and Vandenberghe [p.546] tell us $x_c^* = (I + P^{-1}A^\mathsf{T}(AP^{-1}A^\mathsf{T})^{-1}A)P^{-1}q$ while $x^* = P^{-1}q$. Hence it suffices to show the operator $I + P^{-1}A^\mathsf{T}(AP^{-1}A^\mathsf{T})^{-1}A$ is a contraction under some metric.

Unfortunately, I just sampled a random $A$ and positive $P$, and the above operator is not a contraction in the $\ell^2$-norm in general.


  • is $\|x_c^*\|_2 \leq \|x^*\|_2$ in general?
  • if not, is this true under a different norm such as $\|\cdot\|_P$?

If possible, a bound not involving $A$ would be helpful.

What is an "Instanton" in classical gauge theory? (to a mathematician)

Math Overflow Recent Questions - Sat, 12/30/2017 - 03:09

There's already a question about the same topic but I think its aim is different.

Classical (non-quantum) gauge theory is a completely rigorous mathematical theory. It can be phrased in completely differential-geometric terms (where the main players are bundle with connections on a manifold).

I think I have a basic understanding of what gauge theory is about and what various words mean in this context (yang mils, potential, energy, etc...). However I have still not managed to figure out what "Instanton" means in this context.

What is an Instanton?

Is it something special to Yang-Mils theory? Is it something special to Quantum Gauge theory? Are there any mathematical interpretations/applications for Instantons?

Cotangent complex of perfect algebra over a perfect field

Math Overflow Recent Questions - Sat, 12/30/2017 - 01:23

Let $A$ be a perfect $\kappa$-algebra over a perfect field $\kappa$ of positive characteristic $p$. Then the algebraic (= classical) cotangent complex $L_{A/\kappa}^{\operatorname{alg}}$ is known to vanish, due to the Frobenious automorphism having simultaneously to induce on the cotangent complex an automorphism and multiplication by $p$.

But we can also view $A$ and $\kappa$ as discrete $\mathbb E_\infty$-rings. The cotangent complex $L_{A/\kappa}$, which we obtain that way, is generally different from $L^{\operatorname{alg}}_{A/\kappa}$, since their homotopy groups give topological Andre-Quillen homology and (ordinary) Andre-Quillen homology respectively.

Q: Can we still say something about $L_{A/\kappa}$?

For instance:

  1. Does it perhaps vanish?
  2. Are there at least any finiteness results (e.g. when $A$ is a field, is $\dim_A \pi_n L_{A/\kappa} < \infty$)?

Perhaps a bit more broad afterquestion: what is in general the relationship between $L_{B/A}$ and $L^{\operatorname{alg}}_{B/A}$ for a discrete commutative $A$-algebra $B$? Other than that they coincide over the rationals and that $\pi_0$ of both is the module of Kähler differentials $\Omega_{\pi_0B/\pi_0A}$, of course.

Thanks in advance!

Application of simple Lie algebras over finite fields

Math Overflow Recent Questions - Fri, 12/29/2017 - 19:05

I am now interested in simple Lie algebras over finite fields. In Lie algebras over the complex numbers, there are several applications and some related topics.

Is there any potential application for simple Lie algebras over finite fields, or anything related? Perhaps, in coding theory or graph theory?

Chow ring of product of Brauer-Severi Varieties

Math Overflow Recent Questions - Fri, 12/29/2017 - 15:11

Let $K$ be a field, $\alpha, \beta \in \mathrm{Br}(K)$, let $X,Y$ be their Brauer-Severi Varieties, is there a way to calculate $A^*(X\times Y)$?

For example, if $\alpha,\beta$ both has degree $5$, $2\alpha=\beta$, then $A^*(X\times Y)$ is a subring (Will two non-rational equivalents cycles become rational equivalent after base change?) of $A^*(X\times Y_{\overline{K}})=A^*(\mathbb{P^4}\times\mathbb{P^4})=Z[H_1,H_2]/(H_1^5,H_2^5)$. Then $5H_i\in A^1$, $H_i\notin A^1$, but $4H_1+3H_2\in A^1$, as it is the first Chern class of the vector bundle bundle $O(1)\boxtimes (\Omega\otimes O(2))$ on $X\times Y$.

Is there a closed form for $2, 5, 4, 5, 6, 4, 41, 39, 3, 11, 9, 38, 7, 41, 10, 39, 8, 37, 3, 11, 40, \ldots$? [on hold]

Math Overflow Recent Questions - Thu, 12/28/2017 - 21:18

Is there a closed form for the following series?

$$2, 5, 4, 5, 6, 4, 41, 39, 3, 11, 9, 38, 7, 41, 10, 39, 8, 37, 3, 11, 40, \ldots$$

This is related to the number of odds (or 3n+1 transforms) in the Collatz sequences for the odds $3, 7, 11, 15, ...$

A general series for the number of odds (or tripling steps) in the Collatz sequence for the natural numbers is given by on OEIS, but I'm trying to make it work for these particular odds as they are very important in a paper I'm working on.

Any help or insight is much appreciated!

A minimal eigenvalue inequality

Math Overflow Recent Questions - Thu, 12/28/2017 - 19:46

Suppose $A$ is an $n\times n$ real symmetric positive definite matrix. Let $A^{(-1)}_{i,j}$ be the $n\times n$ matrix the entries $(i,i),\,(i,j),\,(j,i),\,(j,j)$ of which equal to the corresponding entries of the inverse of the row $i$ column $j$ principal minor of $A$, and all other entries zero. Define $$B:=\frac{1}{n-1}\sum_{i<j}A_{i,j}^{(-1)},\quad P:=\big(\text{diag}(A)\big)^{-1},$$ and $\lambda_{\min}(M)$ to be the minimal eigenvalue of matrix $M$ (with all real eigenvalues).

Random test suggests the following inequality. Is it true? $$\lambda_{\min}(PA)\le \lambda_{\min}(BA)$$

It is true for $n=2$.

This is an equivalent and simplified reformulation of a problem in with a bounty. If one finds a proof, one can reap more points and snatch the bounty there.

Invariant proof that De Rham differential is a derivation?

Math Overflow Recent Questions - Thu, 12/28/2017 - 17:50

I tried this question twice on math.stackexchange but got no answer so I decided to move it here.

Let $M$ be a smoth manifold. Then $$C^\infty(M):=\{f:M\longrightarrow \mathbb R; f\ \textrm{is smooth}\},$$ is an $\mathbb R$-algebra with the pointwise product.

If you don't know anything about smooth manifolds it doesn't matter, all that you need to know is that $C^\infty(M)$ is an $\mathbb R$-algebra for all that follows is purely algebraic.

Let us define the space of vector fields on $M$ by: $$\mathfrak{X}(M):=\mathsf{der}_{\mathbb R}\ C^\infty(M):=\{X\in \mathsf{End}_{\mathbb R}(C^\infty(M)): X(fg)=fX(g)+X(f)g\}.$$ This is a $C^\infty(M)$-module with $$(f\cdot X)(g):=f X(g),$$

where $fX(g)$ is the pointwise product of the functions $f$ and $X(g)$.

We can then define the space of $p$-forms on $M$ as the $C^\infty(M)$-module:

$$\Omega^p(M):=\mathsf{Hom}_{C^\infty(M)}(\Lambda^p \mathfrak{X}(M), C^\infty(M)).$$ The De Rham differential on $M$ is the degree one operator $$d: \Omega^p(M)\longrightarrow \Omega^{p+1}(M)$$ given by $$\begin{eqnarray*} d\varepsilon(X_{1}, \ldots, X_{p+1})&&:=\sum_{\sigma\in\mathsf{Sh}(1, p)} \mathsf{sgn}(\sigma) X_{\sigma(1)}(\varepsilon(X_{\sigma(2)}, \ldots, X_{\sigma(p+1)})\\ &&+\sum_{\sigma\in\mathsf{Sh}(2, p-1)}\mathsf{sgn}(\sigma) \varepsilon([X_{\sigma(1)}, X_{\sigma(2)}], X_{\sigma(3)}, \ldots, X_{\sigma(p+1)}), \end{eqnarray*}$$ where $[\cdot, \cdot]$ is the commutator of vector fields which is defined by $$[X, Y]:=X\circ Y-Y\circ X.$$

Notation: For integers $p, q\geq 1$ let us write $S(p, q)$ as the subset of permutations $\sigma$ of the set $\{1, \ldots, p+q\}$ such that $\sigma(1)<\ldots< \sigma(p)$ and $\sigma(p+1)<\ldots< \sigma(p+q)$. The elements of $\mathsf{Sh}(p, q)$ are known as $(p, q)$-shufles for obvious resons.

Now, we can define a product $$\wedge: \Omega^p(M)\times \Omega^q(M)\longrightarrow \Omega^{p+q}(M)$$ setting $$(\varepsilon\wedge \eta)(X_1, \ldots, X_{p+q}):=\sum_{\sigma\in\mathsf{Sh}(p, q)} \mathsf{sgn}(\sigma) \varepsilon(X_{\sigma(1)}, \ldots, X_{\sigma(p)}) \eta(X_{\sigma(p+1)}, \ldots, X_{\sigma(p+q)}).$$ Can anyone help me to prove $$d(\varepsilon\wedge \eta)=d\varepsilon\wedge \eta+(-1)^p \varepsilon\wedge d\eta,$$ for every $\varepsilon\in \Omega^p(M)$ and $\eta\in \Omega^q(M)$?

I know the property I want to show is a classical one but I can't seem to find the proof using this algebraic formulation. I've already asked this question before and got no answer.

However, by that time things were more obscure so I decided to update with this improved version hoping someone could help me.

Remark: 1) The cardinality of the set $\mathsf{Sh}(p, q)$ is $\binom{p+q}{q}$. Hence we easily see there are bijections:

$$\mathsf{Sh}(1, p+q)\times \mathsf{Sh}(p, q)\longrightarrow \mathsf{Sh}(p+1, q)\times \mathsf{Sh}(1, p)$$


$$\mathsf{Sh}(1, p+q)\times \mathsf{Sh}(p, q)\longrightarrow \mathsf{Sh}(p, q+1)\times \mathsf{Sh}(1, q).$$

So the problem boils do to writing those bijections explicitly.

Locally presentable abelian categories with enough injective objects

Math Overflow Recent Questions - Wed, 12/27/2017 - 17:43

I came to the following question when thinking about the (infinitely generated) tilting-cotilting correspondence, where it appears to be relevant.

Does there exist a locally presentable abelian category with enough injective objects that is not a Grothendieck category?

Background: an abelian category is called Grothendieck if it has a generator and satisfies the axiom Ab5. The latter means that (the category is cocomplete and) the filtered colimit functors are exact. Any locally presentable category has a generator, so the question is really about existence of locally presentable abelian categories with enough injective objects, but nonexact filtered colimits.

An abelian category is said to satisfy Ab3 if it is cocomplete. Any locally presentable category is cocomplete by definition. An abelian category is said to satisfy Ab4 if it is cocomplete and the coproduct functors are exact. Any cocomplete abelian category with enough injective objects satisfies Ab4.

The category opposite to the category of vector spaces over some fixed field is cocomplete and has enough injective objects, but it does not satisfy Ab5 (because the category of vector spaces does not satisfy Ab5*, i.e., does not have exact filtered limits). The category opposite to the category of vector spaces is not locally presentable, though.

Any locally finitely presentable abelian category is Grothendieck, and any Grothendieck abelian category is locally presentable, but the converse implications do not hold. Any Grothendieck abelian category has enough injective objects. Does a locally presentable abelian category with enough injective objects need to be Grothendieck?

Semantics of derivations as derivatives

Math Overflow Recent Questions - Wed, 12/27/2017 - 17:08

My understanding of how derivations on commutative rings are like derivatives is that a derivation on $R$ is differentiation with respect to a vector field on $\text{Spec}(R)$. But derivations are supposed to be thought of as like derivatives in a wider context than commutative rings, and I don't really understand how.

Take anti-derivations on the exterior algebra of differential forms on a manifold, for instance. The exterior derivative and Lie derivatives both give you information about infinitesimal change in a differential form, but the interior derivative is defined pointwise, as an anti-derivation on the exterior algebra of the tangent space at each point, which ruins any attempt to think of anti-derivations on differential forms as capturing some information about infinitesimal change. So how can you think about interior differentiation as being like a derivative in any more concrete sense than that it obeys similar syntactic rules? More generally, how can you think about anti-derivations on exterior algebras (or more generally still, on anti-commutative graded rings) as being like a derivative?

There's also derivations on non-commutative rings. The adjoint action of an element of a ring $\text{ad}_x(y):=xy-yx$ is a derivation, but I don't see the significance of this. For example, the Pincherle derivative seems to act like a sort of "differentiation with respect to $d/dx$" insofar as it sends $d/dx$ to $1$, and the fact that it is a derivation forces certain other facts that this heutristic naively suggests to be true (for instance, that the shift operator $S_1=e^{d/dx}$ is its own Pincherle derivative). Is there some more precise way to describe the Pincherle derivative as differentiation with respect to $d/dx$? What about a way to characterize arbitrary derivations on non-commutative rings?

How about derivations on Lie algebras? The Jacobi identity can be interpreted as saying that adjoint actions are derivations, but as in the analogous fact I mentioned for derivations on non-commutative rings, I'm curious about what the significance of this is. And about how to think of arbitrary derivations on Lie algebras.

WGS84 to Cartesian [on hold]

Math Overflow Recent Questions - Wed, 12/27/2017 - 16:37

I'm trying to convert Latitude, Longitude, and Altitude values into Cartesian coordinates so I can use them as points in a Unity application I'm making. I'm using the function below. Only issue is that when I create 3d visualizations using my data, it seems to be systematically off from where they should be (if you view the image, all that data should be on relatively the same Y value. Almost as if I have to rotate the points to make it correctly correspond to its real locations. Do I need to do something more to adjust for the spherical nature of the earth? This data is only across a mile or so. I've included a picture of this. Visualization of data

/// Converts WGS84 lat/lon/height to XYZ /// References /// /// /// </summary> /// <returns>The WGS84 to Cartesian coordinates.</returns> /// <param name="lat">Latitude</param> /// <param name="lon">Longitude</param> /// <param name="h">height.</param> Vector3 WGS84ToCartesian(float lat, float lon, float h) { float earthRadius = 6378137.0f; float cosLat = Mathf.Cos(lat * Mathf.PI / 180.0f); float sinLat = Mathf.Sin(lat * Mathf.PI / 180.0f); float cosLon = Mathf.Cos(lon * Mathf.PI / 180.0f); float sinLon = Mathf.Sin(lon * Mathf.PI / 180.0f); float f = 1.0f / 298.257224f; float C = 1.0f / Mathf.Sqrt(cosLat * cosLat + (1 - f) * (1 - f) * sinLat * sinLat); float S = (1.0f - f) * (1.0f - f) * C; float x = (earthRadius * C + h) * cosLat * cosLon; float y = (earthRadius * C + h) * cosLat * sinLon; float z = (earthRadius * S + h) * sinLat; return new Vector3(x, y, z); }


Subscribe to curious little things aggregator