Skip to content

Commit

Permalink
Removed of all non-mathematical φ's
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiker committed Oct 21, 2024
1 parent 87547a0 commit 13482fa
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 35 deletions.
2 changes: 2 additions & 0 deletions das2/property.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ DasErrCode DasProp_init(
uFlags |= (DASPROP_REAL | DASPROP_SINGLE);
else if(strcasecmp(sType, "realrange") == 0)
uFlags |= (DASPROP_REAL | DASPROP_RANGE);
else if(strcasecmp(sType, "realArray") == 0)
uFlags |= (DASPROP_REAL | DASPROP_SET);
else if(strcasecmp(sType, "doublearray") == 0)
uFlags |= (DASPROP_REAL | DASPROP_SET);
else if((strcasecmp(sType, "time") == 0)||(strcasecmp(sType, "datetime") == 0))
Expand Down
34 changes: 17 additions & 17 deletions das2/vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ static const char* g_nBuiltDirs[][4] = {

{ "", "", "", ""}, /* 0x00000000 */
{ "x", "y", "z", ""}, /* DAS_VSYS_CART */
{ "ρ", "ϕ", "z", ""}, /* DAS_VSYS_CYL */
{ "r", "θ", "ϕ", ""}, /* DAS_VSYS_SPH */
{ "r", "ϕ", "θ", ""}, /* DAS_VSYS_CENTRIC */
{ "ϕ", "θ", "a", ""}, /* DAS_VSYS_DETIC */
{ "ϕ", "θ", "a", ""} /* DAS_VSYS_GRAPHIC */
{ "ρ", "φ", "z", ""}, /* DAS_VSYS_CYL */
{ "r", "θ", "φ", ""}, /* DAS_VSYS_SPH */
{ "r", "φ", "θ", ""}, /* DAS_VSYS_CENTRIC */
{ "φ", "θ", "a", ""}, /* DAS_VSYS_DETIC */
{ "φ", "θ", "a", ""} /* DAS_VSYS_GRAPHIC */
};

const char* das_compsys_str( ubyte uFT)
Expand Down Expand Up @@ -96,7 +96,7 @@ ubyte das_compsys_id(const char* sFT)
* eastward we might reasonable have principle component tokens from
* the frame of:
*
* R, θ, ϕ
* R, θ, φ
*
* Which make it look like these are spherical coordiantes, but they
* are not!
Expand All @@ -112,39 +112,39 @@ const char* das_compsys_desc(ubyte uST)
"is (x,y,z). Missing components are assumed to be 0.";
case DAS_VSYS_CYL:
return "An ISO 31-11 standard cylindrical system. The full componet set "
"is (ρ,ϕ,z) where ρ is distance to the z-axis, φ is eastward "
"is (ρ,φ,z) where ρ is distance to the z-axis, φ is eastward "
"angle. Z is assumed to be 0 if missing, ρ assumed to be 1 "
"if missing.";
case DAS_VSYS_SPH:
return "An ISO 31-11 standard spherical system. The full component set "
"is (r,θ,ϕ) where r is the radial diretion, θ is the colatitude "
"(which is 0° at the north pole) and ϕ is the eastward angle. "
"Both θ, ϕ are assumed to be 0° if missing and r is assumed to "
"is (r,θ,φ) where r is the radial diretion, θ is the colatitude "
"(which is 0° at the north pole) and φ is the eastward angle. "
"Both θ, φ are assumed to be 0° if missing and r is assumed to "
"be 1 if missing.";

case DAS_VSYS_CENTRIC:
return "A spherical system. The full component set is (r, ϕ, θ) where "
"'r' is the radial direction, 'ϕ'' is the eastward direction and "
"'θ' is positive towards the pole. Both 'θ' and 'ϕ' are assumed "
return "A spherical system. The full component set is (r, φ, θ) where "
"'r' is the radial direction, 'φ'' is the eastward direction and "
"'θ' is positive towards the pole. Both 'θ' and 'φ' are assumed "
"to be 0° if missing and 'r' is assumed to be 1 if not specified.";

case DAS_VSYS_DETIC:
return "An ellipsoidal coordinate system defined with respect to a "
"reference surface. Normals from the surface do not intersect"
"the origin except at the equator and poles. The full "
"component set is (ϕ, θ, a) where 'ϕ' is the eastward angle of a"
"component set is (φ, θ, a) where 'φ' is the eastward angle of a"
"point on the reference ellipsoid, 'θ' is the latitude and 'a' "
"is the distance outside the ellipsoid along a surface normal. "
"All of 'a', 'θ' and 'ϕ' are assumed to be 0 if absent.";
"All of 'a', 'θ' and 'φ' are assumed to be 0 if absent.";

case DAS_VSYS_GRAPHIC:
return "An ellipsoidal coordinate system defined with respect to a "
"reference surface. Normals from the surface do not intersect"
"the origin except at the equator and poles. The full "
"component set is (a, ϕ, θ) where 'ϕ' is the WESTWARD angle of a"
"component set is (a, φ, θ) where 'φ' is the WESTWARD angle of a"
"point on the reference ellipsoid, 'θ' is the latitude and 'a' "
"is the distance outside the ellipsoid along a surface normal. "
"All of 'a', 'θ' and 'ϕ' are assumed to be 0 if absent.";
"All of 'a', 'θ' and 'φ' are assumed to be 0 if absent.";
}
return "";
}
Expand Down
29 changes: 23 additions & 6 deletions das2/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,34 @@ DAS_API const char* das_compsys_desc(ubyte systype);
* right-handed triplet */
DAS_API int8_t das_compsys_index(ubyte systype, const char* sSymbol);


/** Note on Unicode character phi: φ
*
* There are two representations, one is used as a symbol and is normally
* rendered with a straight line. The other is loopy and is preferred
* in mathematical contexts. We use the mathematical one here. In short:
*
* φ, U+03C6, 0xCF 0x86 (utf-8) <------ is the one used.
* ϕ, U+03D5, 0xCF 0x95 (utf-8) <------ is *not* used
*
* To make matters worse, many fonts render *both* characters *the same*
* when they should be distinct.
*
* In the future some way of spelling out 'phi' and 'theta' should be added
* to the library.
*/

/** Given the index of a component in the standard right-handed triplet
* get it's standard symbol.
*
* The standard symbols vary by the vector system type, they are:
*
* Cartesian: (x, y, z)
* Cylendrical: (ρ, ϕ, z)
* Spherical: (r, θ, ϕ)
* Centric: (r, ϕ, θ)
* Detic: (ϕ, θ, a)
* Graphic: (ϕ, θ, a)
* Cylendrical: (ρ, φ, z)
* Spherical: (r, θ, φ)
* Centric: (r, φ, θ)
* Detic: (φ, θ, a)
* Graphic: (φ, θ, a)
*
* All arranged to generate a right-handed coordinate system.
*/
Expand Down Expand Up @@ -213,7 +230,7 @@ int das_geovec_dirs(const das_geovec* pThis, ubyte* pDirs);
* @param iIndex The component number, must be 0 to number of components - 1
*
* @returns a very short string (4 bytes or less, including the null) Typical
* returns are "x", "y", "ϕ", "θ'", etc.
* returns are "x", "y", "φ", "θ'", etc.
*
* @memberof das_geovec
*/
Expand Down
24 changes: 12 additions & 12 deletions utilities/das3_spice.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ void prnHelp()
" are assumed. The following list of coordinate systems are supported:\n"
"\n"
" (cart)esian - Cartesian x, y, z (the default)\n"
" (cyl)drical - ISO 31-11 ρ, ϕ, z\n"
" (sph)erical - ISO 31-11 r, θ, ϕ (θ = colat, North pole @ 0°)\n"
" planeto(centric)- Spherical r, ϕ, θ' (θ' = lat, +lon to East)\n"
" planeto(detic) - Ellipsoidal ϕ, θ',r' (θ' = lat, +lon to East, r' = alt)\n"
" planeto(graphic)- Ellipsoidal ϕ, θ',r' (θ' = lat, +lon to West, r' = alt)\n"
" (cyl)drical - ISO 31-11 ρ, φ, z\n"
" (sph)erical - ISO 31-11 r, θ, φ (θ = colat, North pole @ 0°)\n"
" planeto(centric)- Spherical r, φ, θ' (θ' = lat, +lon to East)\n"
" planeto(detic) - Ellipsoidal φ, θ',r' (θ' = lat, +lon to East, r' = alt)\n"
" planeto(graphic)- Ellipsoidal φ, θ',r' (θ' = lat, +lon to West, r' = alt)\n"
"\n"
" Full names can be used, but just the portion in parenthesis is sufficient.\n"
"\n"
Expand Down Expand Up @@ -1297,19 +1297,19 @@ DasErrCode _writeLocation(DasDs* pDsIn, XCalc* pCalc, double rTimeShift)

if(uSysOut != DAS_VSYS_CART){ /* Convert output coord sys if needed */
switch(uSysOut){
case DAS_VSYS_CYL: /* ρ,ϕ,z */
case DAS_VSYS_CYL: /* ρ,φ,z */
reccyl_c(aRecOut, aTmp, aTmp+1, aTmp+2);
aTmp[1] *= dpr_c(); /* Always output degrees */
break;
case DAS_VSYS_SPH: /* r,θ,ϕ */
case DAS_VSYS_SPH: /* r,θ,φ */
recsph_c(aRecOut, aTmp, aTmp+1, aTmp+2);
aTmp[1] *= dpr_c(); aTmp[2] *= dpr_c();
break;
case DAS_VSYS_CENTRIC: /* radius (r), long (ϕ), lat (θ) */
case DAS_VSYS_CENTRIC: /* radius (r), long (φ), lat (θ) */
reclat_c(aRecOut, aTmp, aTmp+1, aTmp+2);
aTmp[1] *= dpr_c(); aTmp[2] *= dpr_c();
break;
case DAS_VSYS_DETIC: /* long (ϕ), lat (θ), alt (r') */
case DAS_VSYS_DETIC: /* long (φ), lat (θ), alt (r') */
recgeo_c(aRecOut, radOut, flatOut, aTmp, aTmp+1, aTmp+2);
aTmp[0] *= dpr_c(); aTmp[1] *= dpr_c();
break;
Expand Down Expand Up @@ -1423,15 +1423,15 @@ DasErrCode _writeRotation(DasDs* pDsIn, XCalc* pCalc, double rTimeShift)
/* Convert non-cart output coords, always output degrees */
if(uSysOut != DAS_VSYS_CART){
switch(uSysOut){
case DAS_VSYS_CYL: /* ρ,ϕ,z */
case DAS_VSYS_CYL: /* ρ,φ,z */
reccyl_c(aRecOut, aTmp, aTmp+1, aTmp+2);
aTmp[1] *= dpr_c();
break;
case DAS_VSYS_SPH: /* r,θ,ϕ */
case DAS_VSYS_SPH: /* r,θ,φ */
recsph_c(aRecOut, aTmp, aTmp+1, aTmp+2);
aTmp[1] *= dpr_c(); aTmp[2] *= dpr_c();
break;
case DAS_VSYS_CENTRIC: /* radius (r), long (ϕ), lat (θ) */
case DAS_VSYS_CENTRIC: /* radius (r), long (φ), lat (θ) */
reclat_c(aRecOut, aTmp, aTmp+1, aTmp+2);
aTmp[1] *= dpr_c(); aTmp[2] *= dpr_c();
break;
Expand Down

0 comments on commit 13482fa

Please sign in to comment.