surface_point Function

private pure function surface_point(r, lat, lon) result(p)

The point at geodetic latitude lat and longitude lon on the ellipsoid (OpenFrames' LatLonGrid formula: the surface point whose normal has those angles).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: r(3)

semi-axes (scene units)

real(kind=wp), intent(in) :: lat

radians

real(kind=wp), intent(in) :: lon

radians

Return Value real(kind=wp), (3)


Called by

proc~~surface_point~~CalledByGraph proc~surface_point surface_point proc~make_grid make_grid proc~make_grid->proc~surface_point proc~grid_build_contents LatLonGrid%grid_build_contents proc~grid_build_contents->proc~make_grid proc~grid_set_color LatLonGrid%grid_set_color proc~grid_set_color->proc~make_grid proc~grid_set_parameters LatLonGrid%grid_set_parameters proc~grid_set_parameters->proc~make_grid proc~set_line_widths LatLonGrid%set_line_widths proc~set_line_widths->proc~make_grid

Source Code

    pure function surface_point(r, lat, lon) result(p)
        real(wp), intent(in) :: r(3)                        !! semi-axes (scene units)
        real(wp), intent(in) :: lat, lon                    !! radians
        real(wp) :: p(3), n(3), r2(3)
        n = [cos(lat) * cos(lon), cos(lat) * sin(lon), sin(lat)]
        r2 = r**2
        p = r2 * n / sqrt(dot_product(r2, n**2))
    end function surface_point