     func computeTime(G: Double, t: Double) -> Double {
         let D = sunDeclination(JDate + t)
         let Z = computeMidDay(t)
-        let Beg = -dsin(G) - dsin(D) * dsin(lat)
-        let Mid = dcos(D) * dcos(lat)
-        let V = darccos(Beg/Mid)/15.0
+        let Beg = -Double.dSin(G) - Double.dSin(D) * Double.dSin(lat)
+        let Mid = Double.dCos(D) * Double.dCos(lat)
+        let V = Double.dArcCos(Beg/Mid)/15.0
         return Z + (G > 90 ? -V : V)
     }
     

        
    }
    
    public func tuneTimes(var times: [Double]) -> [Double] {
        for i in 0...times.count-1{
            times[i] = times[i]+offsets[i]/60.0
        }
        
        
        return times
    }
    
    public func getTimeNames() -> [String]{
        return timeNames
    }
}

    public init(caculationmethod: CalculationMethods, asrJuristic: AsrJuristicMethods, adjustHighLats:AdjustingMethods , timeFormat:TimeForamts, offsets:[Double]){
        self.offsets = offsets
    }
    
    
    
    
    
    
    // ---------------------- Julian Date Functions -----------------------
    // calculate julian date from a calendar date
    func julianDate(year: Int, month: Int, day: Int) -> Double{
        
        var adujestedYear = year
        var adujestedMonth = month
        
        if (adujestedMonth <= 2) {
            adujestedYear = adujestedYear - 1
            adujestedMonth = adujestedMonth + 12
        }
        
        let a = floor(Double(adujestedYear) / 100.0)
        let b = 2 - a + floor(a / 4.0)
        let jd1 = floor(365.25 * Double(adujestedYear + 4716))
        let jd2 = floor(30.6001 * Double(adujestedMonth + 1))
        let jd = jd1 + jd2 + Double(day) + b - 1524.5
        
        return jd
