コード例 #1
0
ファイル: wallsunits.cpp プロジェクト: jlillest/dewalls
void WallsUnits::rectToCt(ULength north, ULength east, ULength up, ULength& distance, UAngle& azm, UAngle& inc) const
{
    ULength ne2 = usq(north) + usq(east);
    ULength ne = usqrt(ne2); // horizontal offset
    if (!up.isValid()) up = ULength(0, Length::m());

    distance = usqrt(ne2 + usq(up)).in(d_unit);
    azm = uatan2(east, north).in(a_unit);
    if (azm < UAngle(0, Angle::degrees()))
    {
        azm += UAngle(360.0, Angle::degrees());
    }
    inc = uatan2(up, ne).in(v_unit);
}
コード例 #2
0
ファイル: wallsunits.cpp プロジェクト: jlillest/dewalls
void WallsUnits::applyHeightCorrections(ULength& dist, UAngle& fsInc, UAngle& bsInc, ULength ih, ULength th) const
{
    if (inch.isNonzero() || ih.isNonzero() || th.isNonzero())
    {
        UAngle inc = avgInc(fsInc + incv, bsInc + incvb);
        if (inc.isValid() && !isVertical(inc))
        {
            // horizontal offset before height correction
            ULength ne = ucos(inc) * (dist + incd);
            // vertical offset before height correction
            ULength u = usin(inc) * (dist + incd);

            u += inch;
            if (ih.isValid()) u += ih;
            if (th.isValid()) u -= th;

            // adjust fsInc/bsInc so that their new avg
            // is the corrected inclination
            UAngle dinc = uatan2(u, ne) - inc;
            fsInc += dinc;
            bsInc += (typevb_corrected ? dinc : -dinc);

            dist = usqrt(usq(ne) + usq(u)) - incd;
        }
    }
}
コード例 #3
0
ファイル: sora_ext_lib.c プロジェクト: travisfcollins/Ziria
int32 __ext_atan2_int32 ( int32 y, int32 x ) {
	return uatan2((int)y, (int)x);
}
コード例 #4
0
ファイル: sora_ext_lib.c プロジェクト: travisfcollins/Ziria
int16 __ext_atan2_int16 ( int16 y, int16 x ) {
	return (int16)uatan2((int)y, (int)x);
}