当前位置: 首页>>代码示例>>Golang>>正文


Golang Angle.Sin方法代码示例

本文整理汇总了Golang中github.com/soniakeys/unit.Angle.Sin方法的典型用法代码示例。如果您正苦于以下问题:Golang Angle.Sin方法的具体用法?Golang Angle.Sin怎么用?Golang Angle.Sin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/soniakeys/unit.Angle的用法示例。


在下文中一共展示了Angle.Sin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: TopocentricEcliptical

// TopocentricEcliptical returns topocentric ecliptical coordinates including parallax.
//
// Arguments λ, β are geocentric ecliptical longitude and latitude of a body,
// s is its geocentric semidiameter. φ, h are the observer's latitude and
// and height above the ellipsoid in meters.  ε is the obliquity of the
// ecliptic, θ is local sidereal time, π is equatorial horizontal parallax
// of the body (see Horizonal()).
//
// Results are observed topocentric coordinates and semidiameter.
func TopocentricEcliptical(λ, β, s, φ unit.Angle, h float64, ε unit.Angle, θ unit.Time, π unit.Angle) (λʹ, βʹ, sʹ unit.Angle) {
	S, C := globe.Earth76.ParallaxConstants(φ, h)
	sλ, cλ := λ.Sincos()
	sβ, cβ := β.Sincos()
	sε, cε := ε.Sincos()
	sθ, cθ := θ.Angle().Sincos()
	sπ := π.Sin()
	N := cλ*cβ - C*sπ*cθ
	λʹ = unit.Angle(math.Atan2(sλ*cβ-sπ*(S*sε+C*cε*sθ), N))
	if λʹ < 0 {
		λʹ += 2 * math.Pi
	}
	cλʹ := λʹ.Cos()
	βʹ = unit.Angle(math.Atan(cλʹ * (sβ - sπ*(S*cε-C*sε*sθ)) / N))
	sʹ = unit.Angle(math.Asin(cλʹ * βʹ.Cos() * s.Sin() / N))
	return
}
开发者ID:soniakeys,项目名称:meeus,代码行数:26,代码来源:parallax.go

示例2: ApproxTimes

// ApproxTimes computes approximate UT rise, transit and set times for
// a celestial object on a day of interest.
//
// The function argurments do not actually include the day, but do include
// values computed from the day.
//
//	p is geographic coordinates of observer.
//	h0 is "standard altitude" of the body.
//	Th0 is apparent sidereal time at 0h UT at Greenwich.
//	α, δ are right ascension and declination of the body.
//
// Th0 must be the time on the day of interest.
// See sidereal.Apparent0UT.
//
// α, δ must be values at 0h dynamical time for the day of interest.
func ApproxTimes(p globe.Coord, h0 unit.Angle, Th0 unit.Time, α unit.RA, δ unit.Angle) (tRise, tTransit, tSet unit.Time, err error) {
	// approximate local hour angle
	sLat, cLat := p.Lat.Sincos()
	sδ1, cδ1 := δ.Sincos()
	cH0 := (h0.Sin() - sLat*sδ1) / (cLat * cδ1) // (15.1) p. 102
	if cH0 < -1 || cH0 > 1 {
		err = ErrorCircumpolar
		return
	}
	H0 := unit.TimeFromRad(math.Acos(cH0))

	// approximate transit, rise, set times.
	// (15.2) p. 102.
	mt := unit.TimeFromRad(α.Rad()+p.Lon.Rad()) - Th0
	tTransit = mt.Mod1()
	tRise = (mt - H0).Mod1()
	tSet = (mt + H0).Mod1()
	return
}
开发者ID:soniakeys,项目名称:meeus,代码行数:34,代码来源:rise.go

示例3: MoonTopocentric2

// MoonTopocentric2 returns observed topocentric semidiameter of the Moon
// by a less rigorous method.
//
// Δ is distance to Moon in AU, h is altitude of the Moon above the observer's
// horizon.
func MoonTopocentric2(Δ float64, h unit.Angle) unit.Angle {
	return Moon.Mul((1 + h.Sin()*parallax.Horizontal(Δ).Sin()) / Δ)
}
开发者ID:soniakeys,项目名称:meeus,代码行数:8,代码来源:semidiameter.go

示例4: Saturn84

// Saturn84 computes the visual magnitude of Saturn.
//
// The formula is that adopted in "Astronomical Almanac" in 1984.
//
// Argument r is the planet's distance from the Sun, Δ the distance from Earth.
// B is the Saturnicentric latitude of the Earth referred to the plane of
// Saturn's ring. ΔU is the difference between the Saturnicentric longitudes
// of the Sun and the Earth, measured in the plane of the ring.
func Saturn84(r, Δ float64, B, ΔU unit.Angle) float64 {
	s := math.Abs(B.Sin())
	return -8.88 + 5*math.Log10(r*Δ) + .044/math.Abs(ΔU.Deg()) -
		2.6*s + 1.25*s*s
}
开发者ID:soniakeys,项目名称:meeus,代码行数:13,代码来源:illum.go


注:本文中的github.com/soniakeys/unit.Angle.Sin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。