Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8807751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:26:41+00:00 2026-06-14T02:26:41+00:00

I want to plot any polynomial function in C# using the console application, without

  • 0

I want to plot any polynomial function in C# using the console application, without using any windows or forms, I searched a lot but all I found was in window application or involving MATLAB and what I want is something just in the console.

I want it to plot any polynomial function given, for example; the coefficients are stored in an array, and i want to plot the function related to it, for example:

The array is:

double[] array = new double[4] { 2 , 0 , -4 , 3 };

Then the function is: 3X^3 – 4X^2 + 2

And it will be plotted on the XY-Plane like this:

For Example: X + 1

https://i.stack.imgur.com/SD3tb.jpg

Any help is appreciated.

Update:

Using the method you provided, I tried this code:

        WriteAt("|", 40, 0);
        WriteAt("|", 40, 1);
        WriteAt("|", 40, 2);
        WriteAt("|", 40, 3);
        WriteAt("|", 40, 4);
        WriteAt("|", 40, 5);
        WriteAt("|", 40, 6);
        WriteAt("|", 40, 7);
        WriteAt("|", 40, 8);
        WriteAt("|", 40, 9);

        WriteAt("-----------------------------------------", 20, 10);

        WriteAt("|", 40, 11);
        WriteAt("|", 40, 12);
        WriteAt("|", 40, 13);
        WriteAt("|", 40, 14);
        WriteAt("|", 40, 15);
        WriteAt("|", 40, 16);
        WriteAt("|", 40, 17);
        WriteAt("|", 40, 18);
        WriteAt("|", 40, 19);
        WriteAt("|", 40, 20);

        WriteAt("*", 32, 12);
        WriteAt("*", 34, 11);
        WriteAt("*", 36, 10);
        WriteAt("*", 38, 9);
        WriteAt("*", 40, 8);
        WriteAt("*", 42, 7);
        WriteAt("*", 44, 6);
        WriteAt("*", 46, 5);
        WriteAt("*", 48, 4);

And I got this:

https://i.stack.imgur.com/cqLz2.jpg

So, now I have to give the WriteAt function the points that must be drawn but putting in mind that the origin is (40,10) in my plotting ??

I subtract 2 from the x-axis because the “-” is half the size of the “|” so the plot will be kinda scaled.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:26:43+00:00Added an answer on June 14, 2026 at 2:26 am

    You need to use Console.SetCursorPosition and draw “*” as needed as if you have something like 80×25 display with pixels.

    You will need to scale your x and y axis accordingly to fit into screen space. Don’t forget that y on screen is down, when on normal drawings it is up – need to inverse in addition to shift when computing screen position (same as regular graphics).

    Essentials of sample available in the above MSDN article:

    Console.SetCursorPosition(Console.CursorTop+x, Console.CursorLeft+y);
    Console.Write("*");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to plot a function in a form without the forms background being
I have the following file I want to plot using gnuplot bar graphs: Function
I want to plot multiple rowstacked histograms on the same graph using gnuplot. A
I'm new to Perl and want to plot a chart using Excel. I found
I have a data which I want to plot in cumulative function. The R
I want to make a scatter plot using matplotlib. If I want to use
I want to plot a bunch of variables against each other by using a
I want to plot some confidence interval graphs in MATLAB but I don't have
I am reading data continuously from a sensor and want to plot chart using
I want to plot a barplot of some data with some x-axis labels but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.