就当活跃活跃气氛吧~

解决方案 »

  1.   

    高手们不吝啬的话 用sql写写吧
      

  2.   

    //c#的
    using System;   
    using System.Collections.Generic;   
    using System.ComponentModel;   
    using System.Data;   
    using System.Drawing;   
    using System.Text;   
    using System.Windows.Forms;   
      
    namespace WindowsApplication1   
    {   
        public partial class Form1 : Form   
        {   
            int x1, x2, y1, y2;   
            Boolean ht = false;//判断是否按下鼠标左键,默认为没有按键   
            Boolean dr = true; //判断是否已经显示曲线,默认为显示   
            public Form1()   
            {   
                InitializeComponent();   
                   
            }   
      
            /// <summary>   
            /// 鼠标单击事件方法   
            /// </summary>   
            /// <param name="sender"></param>   
            /// <param name="e"></param>   
            private void Form1_MouseDown(object sender, MouseEventArgs e)   
            {   
                //sinline();   
                x1 = e.X; //获取点击处的坐标X值   
                y1 = e.Y; //获取点击处的坐标Y值   
                ht = true; //赋值为真,证明已经按下左键   
                if (dr == true) //判断显示曲线的条件是否为真,如果为真则清楚鼠标所画的各种图形   
                {   
                    Graphics g = this.CreateGraphics();   
                    g.Clear(this.BackColor);   
                    dr = false;   
                }   
                   
            }   
      
               
            /// <summary>   
            /// 正弦曲线方法   
            /// </summary>   
            public void sinline()   
            {   
                int W = this.ClientSize.Width;  //获取窗体宽度   
                int H = this.ClientSize.Height; //获取窗体高度   
                int x0 = 10;  //原点坐标X   
                int y0 = H / 2; //原点坐标Y   
                int Yuint = H / 10; //去窗体高度的1/10   
                int Xuint = W / 50;//在X轴上分为50份,每份为pi/10,用于计算Y值   
                int x1 = 0, y1 = 0;  //画图起点坐标   
                int x2 = 0, y2 = 0;  //画图终点坐标   
                Graphics g = this.CreateGraphics();   
                Pen mypen = new Pen(Color.Red, 3);   
                bool Startbool = true;  //用于判断是否为原点   
                g.DrawLine(mypen, x0, y0, W, y0);  //画X轴   
                g.DrawLine(mypen, x0, H, x0, 0);   //画Y轴   
      
                /*画X轴箭头*/  
                g.DrawLine(mypen, W, y0, W - 10, y0 - 5);   
                g.DrawLine(mypen, W, y0, W - 10, y0 + 5);   
      
                /*画y轴箭头*/  
                g.DrawLine(mypen, x0, 0, x0 - 5, 10);   
                g.DrawLine(mypen, x0, 0, x0 + 5, 10);   
                for (int i = 0; i <= 50; i++)   
                {   
                    if (Startbool == true)   
                    {   
                        //x1=10;   
                        x1 = 10 + i * Xuint;   
                        y1 = (int)(y0-Yuint * Math.Sin(i * 36.0 / 360 * 3.1415926));   
                        Startbool = false;   
                    }   
                    else  
                    {   
                        x2 = 10 + i * Xuint; //计算终点坐标X   
                        y2 = (int)(y0 - Yuint * Math.Sin(i * 36.0 / 180) * 3.1415926);  //计算终点坐标Y   
                        g.DrawLine(mypen, x1, y1, x2, y2);   
                        x1 = x2;   
                        y1 = y2;   
                    }   
                }   
            }   
      
            /// <summary>   
            /// 鼠标移动事件,用于画图时获取各点坐标   
            /// </summary>   
            /// <param name="sender"></param>   
            /// <param name="e"></param>   
            private void Form1_MouseMove(object sender, MouseEventArgs e)   
            {   
                x2 = e.X; //获取实时坐标X   
                y2 = e.Y; //获取实时坐标Y   
                Graphics g = this.CreateGraphics();   
                Pen mypen = new Pen(Color.Blue, 3);   
                if (ht == true) //判断是否按下左键   
                {   
                    g.DrawLine(mypen, x1, y1, x2, y2);   
                    x1 = x2;   
                    y1 = y2;   
                }   
            }   
      
            /// <summary>   
            /// 鼠标释放事件方法   
            /// </summary>   
            /// <param name="sender"></param>   
            /// <param name="e"></param>   
            private void Form1_MouseUp(object sender, MouseEventArgs e)   
            {   
                ht = false;    
                   
            }   
      
            /// <summary>   
            /// 键盘事件方法   
            /// </summary>   
            /// <param name="sender"></param>   
            /// <param name="e"></param>   
            private void Form1_KeyDown(object sender, KeyEventArgs e)   
            {   
                if (e.KeyValue == 13)  //根据键值判断是否按下回车   
                {   
                    Graphics g = this.CreateGraphics();   
                    g.Clear(this.BackColor);   
                    sinline();   
                    dr = true;   
                }   
            }   
        }   
    }   
      

  3.   

    print  你要的图形.
    我很强.谢谢。
      

  4.   

    竖着的行不行?俺还不会行列转换~declare @x float
    declare @tb table(y float)set @x = 0while @x < 360
      begin
        insert into  @tb select ROUND(SIN(RADIANS(@x)) * 100,0)
        set @x = @x + 5
      end 
      
    select space(201 + y - 100 )+ '*' from @tb
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                         *
                                                                                                                  *
                                                                                                                          *
                                                                                                                                   *
                                                                                                                                           *
                                                                                                                                                   *
                                                                                                                                                           *
                                                                                                                                                                  *
                                                                                                                                                                         *
                                                                                                                                                                                *
                                                                                                                                                                                      *
                                                                                                                                                                                           *
                                                                                                                                                                                                *
                                                                                                                                                                                                    *
                                                                                                                                                                                                       *
                                                                                                                                                                                                          *
                                                                                                                                                                                                           *
                                                                                                                                                                                                             *
                                                                                                                                                                                                             *
                                                                                                                                                                                                             *
                                                                                                                                                                                                           *
                                                                                                                                                                                                          *
                                                                                                                                                                                                       *
                                                                                                                                                                                                    *
                                                                                                                                                                                                *
                                                                                                                                                                                           *
                                                                                                                                                                                      *
                                                                                                                                                                                *
                                                                                                                                                                         *
                                                                                                                                                                  *
                                                                                                                                                           *
                                                                                                                                                   *
                                                                                                                                           *
                                                                                                                                   *
                                                                                                                          *
                                                                                                                  *
                                                                                                         *
                                                                                                *
                                                                                        *
                                                                               *
                                                                       *
                                                               *
                                                       *
                                                *
                                         *
                                  *
                            *
                       *
                  *
              *
           *
        *
       *
     *
     *
     *
       *
        *
           *
              *
                  *
                       *
                            *
                                  *
                                         *
                                                *
                                                       *
                                                               *
                                                                       *
                                                                               *
                                                                                        *
                                                                                                *
      

  5.   


    CREATE PROCEDURE P_DrawSin
    (
    @BeDegree decimal (10,2),
    @EdDegree decimal (10,2)
    )
    AS 
    SET NOCOUNT ON
    DECLARE @PAR VARCHAR(50)
    SET @PAR=CONVERT(VARCHAR,@BeDegree)
    IF (CONVERT(INT,@BeDegree)%10)<>0
    BEGIN
    RAISERROR('"%s" 不是10的倍数,请录入10的倍数参数',12,16,@PAR)
    RETURN
    ENDSET @PAR=CONVERT(VARCHAR,@EdDegree)
    IF (CONVERT(INT,@EdDegree)%10)<>0
    BEGIN
    RAISERROR('"%s" 不是10的倍数,请录入10的倍数参数',12,16,@PAR)
    RETURN
    END
      DECLARE @TB TABLE (ADegrees Decimal (10,2),ASine Decimal (10,2))
    DECLARE @TC TABLE (ADegrees Decimal (10,2),ASine Decimal (10,2))
    DECLARE @Sine Decimal (10,2),@Radians   Decimal (10,2),@Degrees Decimal (10,2),@Tmp1 Decimal (10,2),@Tmp2 INT
    DECLARE @SQL VARCHAR(8000),@SQLTMP VARCHAR(8000),@RE VARCHAR(8000)
    SELECT @Radians = Radians(Convert(Float,@BeDegree)),@Degrees=@BeDegree
    WHILE  (@Degrees<=@EdDegree)
    BEGIN
    SET @Sine=ROUND(SIN(@Radians)*10,0)
    INSERT INTO @TB SELECT @Degrees,@Sine
    SET @Degrees=@Degrees+10
    SET @Radians= RADIANS(CONVERT(FLOAT,@Degrees))
    ENDDECLARE SinCURSOR CURSOR READ_ONLY FOR 
    SELECT ADegrees=MIN(ADegrees),ASine FROM @TB GROUP BY ASine ORDER BY ASine  Desc
    OPEN SinCURSORFETCH NEXT FROM SinCURSOR INTO @Degrees,@Sine
    WHILE (@@FETCH_STATUS <> -1)
    BEGIN
    IF @Sine=0
    SET @PAR='0'
    ELSE 
    SET @PAR='*'
    SET @SQL='SPACE('+CONVERT(VARCHAR(10),CEILING(@Degrees-@BeDegree))+'/10)+'''+@PAR+''''
    IF EXISTS (SELECT 1 FROM @TB WHERE ADegrees<>@Degrees AND ASine=@Sine)
    BEGIN
    DELETE @TC
    INSERT INTO @TC SELECT ADegrees,@Sine FROM @TB WHERE ASine=@Sine ORDER BY  ADegrees
    SELECT @Tmp1=NULL,@Tmp2=NULL
    UPDATE @TC
    SET @Tmp1=@Tmp2,
    @Tmp2=ADegrees,
    @SQLTMP=ISNULL(@SQLTMP,'')+'+SPACE('+CONVERT(VARCHAR(10),(ABS(ADegrees-@Tmp1)/10)-1)++')+'''+@PAR+''''
    WHERE ASine=@Sine
    END
    SELECT @RE=CASE WHEN @RE IS NULL THEN '' ELSE @RE+'+CHAR(10)+CHAR(13)+' END + @SQL+ISNULL(@SQLTMP,'') 
    SET @SQL=''
    SET @SQLTMP=''
    FETCH NEXT FROM SinCURSOR INTO @Degrees,@Sine
    END
    CLOSE SinCURSOR
    DEALLOCATE SinCURSOR
    EXEC ('PRINT '+@RE)
    SET NOCOUNT  OFF
    --测试
    exec dbo.P_DrawSin 0,1800/*        ***                                 ***
          **   **                             **   **
         *       *                           *       *
        *         *                         *         *
       *           *                       *           *
      *             *                     *             *
     *               *                   *               *
    0                 0                 0                 0                 0
                       *               *                   *               *
                        *             *                     *             *
                         *           *                       *           *
                          *         *                         *         *
                           *       *                           *       *
                            **   **                             **   **
                              ***                                 ***
    */
      

  6.   

    exec dbo.P_DrawSin 0,720
    /*
            ***                                 ***
          **   **                             **   **
         *       *                           *       *
        *         *                         *         *
       *           *                       *           *
      *             *                     *             *
     *               *                   *               *
    0                 0                 0                 0                 0
                       *               *                   *               *
                        *             *                     *             *
                         *           *                       *           *
                          *         *                         *         *
                           *       *                           *       *
                            **   **                             **   **
                              ***                                 ****/