Total members 11890 |It is currently Thu Apr 18, 2024 3:44 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Draw Hermite Curve using C++ with MFC :

Code:

    vector
<doublexCof GetHermiteCoeff(P0.firstT0.firstP3.firstT1.first);
    
vector<doubleyCof GetHermiteCoeff(P0.secondT0.secondP3.secondT1.second);

    if(
numPix 2) return;
    
double dt 1.0 / (numPix 1);

    
tagLOGPEN tp;
    
tp.lopnColor color;
    
tp.lopnStyle PS_SOLID;
    
tp.lopnWidth.1;
    
HPEN p CreatePenIndirect(&tp);
    
SelectObject(hdcp);
    for(
double t 0<= 1+= dt)
    {
        
vector<doublevt(4);
        
vt[3] = 1;
        
vt[2] = t*vt[3];
        
vt[1] = t*vt[2];
        
vt[0] = t*vt[1];

        
int x round(DotProduct(xCof,vt));
        
int y round(DotProduct(yCof,vt));


        if(
t==0)
            {
            
MoveToEx(hdc,x,y,NULL);
            
SetPixel(hdcxycolor);
            }
        else 
LineTo(hdc,x,y);
    }
    
DeleteObject(p);
 




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Draw Hermite Curve
 Draw curves using Hermite Curve equations with mouse clicks     -  
 Draw Bezier Curve and selecting the points with mouse click     -  
 draw 2d curve with showing x axis and y axis     -  
 Curve XY 2D     -  
 text like a curve     -  
 Curve Control Point in java     -  
 How to draw a gun     -  
 Draw An Arc in java     -  
 Draw pie chart php     -  
 Draw char with color in php     -  



Topic Tags

C++ Graphics
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com