PtTrend problem

Hi:
I want to draw a sin function image,but the result is not a standard sin image.My programme is as follows:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

/* Local headers */
#include “ablibs.h”
#include “abimport.h”
#include “proto.h”
#include “math.h”

#define PI 3.1415
int
done( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )

{
  short data[1000];
   short y[1000];
   int i,j,k;
float m[1000];
 
 data[0]=0;
 data[1]=2;
 data[2]=3;
 data[3]=4;
 data[4]=5;
 data[5]=6;
 data[6]=7;
data[7]=8;
data[8]=9;
data[9]=10;
/* eliminate 'unreferenced' warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
for(i=0;i<1000;i++)
{y[i]=0;}
for(j=0;j<1000;j++)
{k=1000-j;
m[j]=sin(4*PI/k);
  data[j]=(short)(m[j]*100);}


PtSetResource(ABW_trend,Pt_ARG_TREND_MIN,-100,0);
PtSetResource(ABW_trend,Pt_ARG_TREND_MAX,100,0);
PtSetResource(ABW_trend,Pt_ARG_TREND_INC,5,0);
PtTrendChangeData(ABW_trend,(short const*)&data,0,1000);
PtTrendChangeData(ABW_trend,(short const*)&y,0,1000);


return( Pt_CONTINUE );

}

thanks.

Im not sure what you mean by standard sin image`, not everybody has the same idea of what a standard sin image should look like.

I am guessing you are expecting a sin wave , like an S sideways. If that is the case, you should check your math.

You are right,I am expecting a sin wave.The math programe can be realized in a single C programe.I don’t know where the problem is.

Well I took your program, modify it to print number in a file, the numbers didn’t look like a sine wave to me.

what is ABW_trend ? is it right. In my opinion, I think it may be is widget. And I had a try .
thanks

if you want to set more than 1 resources of ABW_trend widget,you must use PtSetArg function and PtSetResources.
You can’t use PtSetResource.