Profile Picture

NViewToScale1DTransformation not reversible

Posted By Tobias Breuer 12 Years Ago
Author
Message
Tobias Breuer
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 5, Visits: 11

Hi all,

I have the problem that the NViewToScale1DTransformation function is not reversible.

Following Code Snippet illustrates the problem basicaly:

NPointF viewpoint = new NPointF(x, y); 
double xValue = 0;
double yValue = 0; 
// Transformation rule to obtain the xValue
NViewToScale1DTransformation tranformX = new NViewToScale1DTransformation(_ChartControl.View.Context, _Chart, (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY); 
// Transformation rule to obtain the yValue
NViewToScale1DTransformation tranformY = new NViewToScale1DTransformation(_ChartControl.View.Context, _Chart, (int)StandardAxis.PrimaryY, (int)StandardAxis.PrimaryX);
NScale1DToViewTransformation tranformXRestore = new NScale1DToViewTransformation(_ChartControl.View.Context, _Chart, (int)StandardAxis.PrimaryX); 
NScale1DToViewTransformation tranformYRestore = new NScale1DToViewTransformation(_ChartControl.View.Context, _Chart, (int)StandardAxis.PrimaryY); 
// perform the transformations
tranformX.Transform(viewpoint, ref xValue);
tranformY.Transform(viewpoint, ref yValue); 
NPointF viewPoint2 = new NPointF();
NPointF viewPoint3 = new NPointF(); 
// perform the transformations backwards
tranformXRestore.Transform(xValue, ref viewPoint2);
tranformYRestore.Transform(yValue, ref viewPoint3);
 
When calling the method with initial ViewPoint = (82, 22), the result after NViewToScale1DTransform yields (10.21851, 149.62404)
which is correct. Transforming this back via NScale1DToViewTransform yields (-69039, 233) for viewPoint2 and (241, -89227) for 
viewPoint3. Of course I want to get the inital values (82, 22) back.
Am I missing something here? Is it even possible to retransform the way I want it to be?
Best regards,
Tobias
 





Similar Topics


Reading This Topic