日期:2014-05-16  浏览次数:20397 次

请教下这段C# 用js如何实现

    public class Wave
    {
        private WavePoint startPoint;

        public WavePoint StartPoint
        {
            get { return startPoint; }
            set { startPoint = value; }
        }
        private WavePoint endPoint;

        public WavePoint EndPoint
        {
            get { return endPoint; }
            set { endPoint = value; }
        }


        private List<WavePoint> wavePoint;

        public List<WavePoint> WavePoint
        {
            get { return wavePoint; }
            set { wavePoint = value; }
        }

        /// <summary>
        /// 声导纳值达到峰值的一半处波峰的宽度
        /// </summary>
        /// <param name="ya">声导纳值峰值</param>
        /// <returns></returns>
        public float GetWaveWidth(float ya)
        {
            float result = 0;
            float middleya = ya / 2;  //峰值的一半
            List<WavePoint> lstWave = this.wavePoint;  //当前波的点的集合


            List<WavePoint> jiaodian = new List<WavePoint>();  //以一半为水平线与波交点的集合

            WavePoint lastPoint = new WavePoint();
            lastPoint = this.startPoint;

            //找出波峰与1/2声纳值的交点交点
            foreach (WavePoint item in lstWave)
            {
                //相等

                if (item.Y == middleya)
            &nb