Programing 3
Programing 3
#include <math.h>
#include <graphics.h>
// Define functions to calculate the position of the crank and sliding block
void calculateCrankPosition(double crankAngle) {
// Calculate the x-coordinate of the crank
double crankX = cos(crankAngle) * CRANK_LENGTH / 2;
int main() {
// Initialize graphics window
initwindow(640, 480);
return 0;
}