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


Golang Equatorial.RA方法代码示例

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


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

示例1: PositionRonVondrak

// PositionRonVondrak computes the apparent position of an object using
// the Ron-Vondrák expression for aberration.
//
// Position is computed for equatorial coordinates in eqFrom, considering
// proper motion, aberration, precession, and nutation.  Result is in
// eqTo.  EqFrom and eqTo must be non-nil, but may point to the same struct.
//
// Note the Ron-Vondrák expression is only valid for the epoch J2000.
// EqFrom must be coordinates at epoch J2000.
func PositionRonVondrak(eqFrom, eqTo *coord.Equatorial, epochTo float64, mα sexa.HourAngle, mδ sexa.Angle) *coord.Equatorial {
	t := epochTo - 2000
	eqTo.RA = eqFrom.RA + mα.Rad()*t
	eqTo.Dec = eqFrom.Dec + mδ.Rad()*t
	jd := base.JulianYearToJDE(epochTo)
	Δα, Δδ := AberrationRonVondrak(eqTo.RA, eqTo.Dec, jd)
	eqTo.RA += Δα
	eqTo.Dec += Δδ
	precess.Position(eqTo, eqTo, 2000, epochTo, 0, 0)
	Δα1, Δδ1 := Nutation(eqTo.RA, eqTo.Dec, jd)
	eqTo.RA += Δα1
	eqTo.Dec += Δδ1
	return eqTo
}
开发者ID:thecc4re,项目名称:meeus,代码行数:23,代码来源:apparent.go

示例2: PositionRonVondrak

// PositionRonVondrak computes the apparent position of an object using
// the Ron-Vondrák expression for aberration.
//
// Position is computed for equatorial coordinates in eqFrom, considering
// proper motion, aberration, precession, and nutation.  Result is in
// eqTo.  EqFrom and eqTo must be non-nil, but may point to the same struct.
//
// Note the Ron-Vondrák expression is only valid for the epoch J2000.
// EqFrom must be coordinates at epoch J2000.
func PositionRonVondrak(eqFrom, eqTo *coord.Equatorial, epochTo float64, mα unit.HourAngle, mδ unit.Angle) *coord.Equatorial {
	t := epochTo - 2000
	eqTo.RA = eqFrom.RA.Add(mα.Mul(t))
	eqTo.Dec = eqFrom.Dec + mδ.Mul(t)
	jd := base.JulianYearToJDE(epochTo)
	Δα, Δδ := AberrationRonVondrak(eqTo.RA, eqTo.Dec, jd)
	eqTo.RA = eqTo.RA.Add(Δα)
	eqTo.Dec += Δδ
	precess.Position(eqTo, eqTo, 2000, epochTo, 0, 0)
	Δα1, Δδ1 := Nutation(eqTo.RA, eqTo.Dec, jd)
	eqTo.RA = eqTo.RA.Add(Δα1)
	eqTo.Dec += Δδ1
	return eqTo
}
开发者ID:soniakeys,项目名称:meeus,代码行数:23,代码来源:apparent.go

示例3: ApproxPosition

// ApproxPosition uses ApproxAnnualPrecession to compute a simple and quick
// precession while still considering proper motion.
//
// Both eqFrom and eqTo must be non-nil, although they may point to the same
// struct.  EqTo is returned for convenience.
func ApproxPosition(eqFrom, eqTo *coord.Equatorial, epochFrom, epochTo float64, mα base.HourAngle, mδ base.Angle) *coord.Equatorial {
	Δα, Δδ := ApproxAnnualPrecession(eqFrom, epochFrom, epochTo)
	dy := epochTo - epochFrom
	eqTo.RA = eqFrom.RA + (Δα+mα).Rad()*dy
	eqTo.Dec = eqFrom.Dec + (Δδ+mδ).Rad()*dy
	return eqTo
}
开发者ID:pjh59,项目名称:meeus,代码行数:12,代码来源:precess.go

示例4: Position

// Position precesses equatorial coordinates from one epoch to another,
// including proper motions.
//
// If proper motions are not to be considered or are not applicable, pass 0, 0
// for mα, mδ
//
// Both eqFrom and eqTo must be non-nil, although they may point to the same
// struct.  EqTo is returned for convenience.
func Position(eqFrom, eqTo *coord.Equatorial, epochFrom, epochTo float64, mα base.HourAngle, mδ base.Angle) *coord.Equatorial {
	p := NewPrecessor(epochFrom, epochTo)
	t := epochTo - epochFrom
	eqTo.RA = eqFrom.RA + mα.Rad()*t
	eqTo.Dec = eqFrom.Dec + mδ.Rad()*t
	return p.Precess(eqTo, eqTo)
}
开发者ID:pjh59,项目名称:meeus,代码行数:15,代码来源:precess.go

示例5: ApproxPosition

// ApproxPosition uses ApproxAnnualPrecession to compute a simple and quick
// precession while still considering proper motion.
//
// Both eqFrom and eqTo must be non-nil, although they may point to the same
// struct.  EqTo is returned for convenience.
func ApproxPosition(eqFrom, eqTo *coord.Equatorial, epochFrom, epochTo float64, mα unit.HourAngle, mδ unit.Angle) *coord.Equatorial {
	Δα, Δδ := ApproxAnnualPrecession(eqFrom, epochFrom, epochTo)
	dy := epochTo - epochFrom
	eqTo.RA = eqFrom.RA.Add((Δα + mα).Mul(dy))
	eqTo.Dec = eqFrom.Dec + (Δδ + mδ).Mul(dy)
	return eqTo
}
开发者ID:soniakeys,项目名称:meeus,代码行数:12,代码来源:precess.go

示例6: Position

// Position precesses equatorial coordinates from one epoch to another,
// including proper motions.
//
// If proper motions are not to be considered or are not applicable, pass 0, 0
// for mα, mδ
//
// Both eqFrom and eqTo must be non-nil, although they may point to the same
// struct.  EqTo is returned for convenience.
func Position(eqFrom, eqTo *coord.Equatorial, epochFrom, epochTo float64, mα unit.HourAngle, mδ unit.Angle) *coord.Equatorial {
	p := NewPrecessor(epochFrom, epochTo)
	t := epochTo - epochFrom
	eqTo.RA = unit.RAFromRad(eqFrom.RA.Rad() + mα.Rad()*t)
	eqTo.Dec = eqFrom.Dec + mδ*unit.Angle(t)
	return p.Precess(eqTo, eqTo)
}
开发者ID:soniakeys,项目名称:meeus,代码行数:15,代码来源:precess.go

示例7: Position

// Position computes the apparent position of an object.
//
// Position is computed for equatorial coordinates in eqFrom, considering
// proper motion, precession, nutation, and aberration.  Result is in
// eqTo.  EqFrom and eqTo must be non-nil, but may point to the same struct.
func Position(eqFrom, eqTo *coord.Equatorial, epochFrom, epochTo float64, mα sexa.HourAngle, mδ sexa.Angle) *coord.Equatorial {
	precess.Position(eqFrom, eqTo, epochFrom, epochTo, mα, mδ)
	jd := base.JulianYearToJDE(epochTo)
	Δα1, Δδ1 := Nutation(eqTo.RA, eqTo.Dec, jd)
	Δα2, Δδ2 := Aberration(eqTo.RA, eqTo.Dec, jd)
	eqTo.RA += Δα1 + Δα2
	eqTo.Dec += Δδ1 + Δδ2
	return eqTo
}
开发者ID:thecc4re,项目名称:meeus,代码行数:14,代码来源:apparent.go

示例8: Precess

// Precess precesses coordinates eqFrom, leaving result in eqTo.
//
// The same struct may be used for eqFrom and eqTo.
// EqTo is returned for convenience.
func (p *Precessor) Precess(eqFrom, eqTo *coord.Equatorial) *coord.Equatorial {
	// (21.4) p. 134
	sδ, cδ := math.Sincos(eqFrom.Dec)
	sαζ, cαζ := math.Sincos(eqFrom.RA + p.ζ)
	A := cδ * sαζ
	B := p.cθ*cδ*cαζ - p.sθ*sδ
	C := p.sθ*cδ*cαζ + p.cθ*sδ
	eqTo.RA = math.Atan2(A, B) + p.z
	if C < base.CosSmallAngle {
		eqTo.Dec = math.Asin(C)
	} else {
		eqTo.Dec = math.Acos(math.Hypot(A, B)) // near pole
	}
	return eqTo
}
开发者ID:pjh59,项目名称:meeus,代码行数:19,代码来源:precess.go

示例9: ProperMotion3D

// ProperMotion3D takes the 3D equatorial coordinates of an object
// at one epoch and computes its coordinates at a new epoch, considering
// proper motion and radial velocity.
//
// Radial distance (r) must be in parsecs, radial velocitiy (mr) in
// parsecs per year.
//
// Both eqFrom and eqTo must be non-nil, although they may point to the same
// struct.  EqTo is returned for convenience.
func ProperMotion3D(eqFrom, eqTo *coord.Equatorial, epochFrom, epochTo, r, mr float64, mα base.HourAngle, mδ base.Angle) *coord.Equatorial {
	sα, cα := math.Sincos(eqFrom.RA)
	sδ, cδ := math.Sincos(eqFrom.Dec)
	x := r * cδ * cα
	y := r * cδ * sα
	z := r * sδ
	mrr := mr / r
	zmδ := z * mδ.Rad()
	mx := x*mrr - zmδ*cα - y*mα.Rad()
	my := y*mrr - zmδ*sα + x*mα.Rad()
	mz := z*mrr + r*mδ.Rad()*cδ
	t := epochTo - epochFrom
	xp := x + t*mx
	yp := y + t*my
	zp := z + t*mz
	eqTo.RA = math.Atan2(yp, xp)
	eqTo.Dec = math.Atan2(zp, math.Hypot(xp, yp))
	return eqTo
}
开发者ID:pjh59,项目名称:meeus,代码行数:28,代码来源:precess.go


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