1/* 2* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. 3* Licensed under the Apache License, Version 2.0 (the "License"); 4* you may not use this file except in compliance with the License. 5* You may obtain a copy of the License at 6* 7* http://www.apache.org/licenses/LICENSE-2.0 8* 9* Unless required by applicable law or agreed to in writing, software 10* distributed under the License is distributed on an "AS IS" BASIS, 11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12* See the License for the specific language governing permissions and 13* limitations under the License. 14*/ 15 16export function fAngle(x,y) 17{ 18 return Math.atan2(-y,x)*180/Math.PI 19} 20export function iDistance(x,y) 21{ 22 return Math.sqrt(x*x+y*y) 23} 24 25export var timeMs=0; 26export function freshTime() 27{ 28 let t=new Date() 29 timeMs=t.getTime() 30} 31freshTime() 32export function TimeMS() 33{ 34 let t=new Date() 35 return t.getTime() 36} 37export function RandInt(min=0,max=100) 38{ 39 return Math.floor(Math.random()*(max-min))+min 40} 41 42export function GetURL() 43{ 44 if("undefined" != typeof wx) 45 { 46 return "https://7465-testegg-19e3c9-1301193145.tcb.qcloud.la/" 47 } 48 else return "" 49}