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

  • Home
  • SEARCH
  • 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 8051111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:14:02+00:00 2026-06-05T07:14:02+00:00

this is the last part of my a bit more complex homework which I

  • 0

this is the last part of my a bit more complex homework which I can’t figure out myself.

Basically it’s a tangent function, drawn to SVG using C.

This is how I’m drawing it:

enter image description here

and this is how it should look like:

enter image description here

it’s pretty much the same except I’m drawing even those lines where tangent isn’t defined.. How do I get rid of that? I’m actually generating that tangent using a simple for cycle, and I understand by changing Lineto to Moveto I will get rid of those line, but how to determine a formula which will be usable for any height/width and any (-x,x) (-y,y). Any thoughts?

Source codes:
link to my drawing | link to original drawing

edit: structure

typedef struct svg_graph{
    int w;
    int h;
    int x;
    int y;
} graph;

and the code itself:

double initializer = 0;
double m = 0;
double temp = 0;

initializer = svg->h/2 - tan(-svg->x)*(((double)svg->h/2)/svg->y);
fprintf(output, "<path clip-path=\"url(#myClip)\" d=\"M 0 %.1f", initializer)
temp = ((double)svg->x/(svg->w/2));
m = svg->h/2 - tan(-svg->x+temp)*((double)(svg->h/2)/svg->y);
for (int i = 1; i<=svg->w; i++){

      fprintf(output, " L %d %.1f", i, m);

      temp = ((double)svg->x/(svg->w/2)) + temp;
      m = svg->h/2 - tan(-svg->x+temp)*((double)(svg->h/2)/svg->y);
}
  • 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-05T07:14:04+00:00Added an answer on June 5, 2026 at 7:14 am

    If the derivative is non-finite then you need a move rather than a line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am fighting this thing and cannot figure it out... can someone please help.
I really need help with this last part of my program. I need to
This is the last part of the program I am working on. I want
I'm SOO close to finishing a pet project, this is the last part I
Hopefully the last part of this menu I've been working on. It've got the
I have seen this question that talks about getting the last part of a
I have this bit of code to get the address of the last cell
I'm having a bit of trouble figuring this one out. I have a dropdownlist
I came across this issue last night where my CSS would not affect the
what is the logic behind this on this website last activity: 1 min ago

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.