Can we bend a line like a curve

i have a line connecting two points and now i have to specify a point on the line so that the line is curved at that point ,can anyone help me in this regard,i am a beginner in java3d.

Use Bezier curves for this purpose
I will give u the code
class Xy -> to plot points x1,y1
class bezier -> to draw the curve
U can call ur codes as
Bezier bz = new Bezier(new XY(23,0),new XY(-3,0),new XY(23,h),new XY(-3,h));
bz.draw(g,45);
this will work
class XY
     public static boolean debug = false;
public XY() {
          local_x = 0;
          local_y = 0;
     public XY(int nx, int ny)
          local_x = nx;
          local_y = ny;
     public XY(XY old)
          local_x = old.x();
          local_y = old.y();
     public int x()
          return local_x;
     public int y()
          return local_y;
     public void multiply ( int x, int y )
          printf("move; from "+local_x+" , "+local_y);
          local_x *= x;
          local_y *= y;
     public void divide ( int x, int y )
          local_x /= x;
          local_y /= y;
          printf(" to "+local_x+" , "+local_y+"\n");
     public void setTime(int t)
     public int x(int t)
          return local_x;
     public int y(int t)
          return local_y;
     public void printf ( String s )
          if ( debug )
               System.out.print ( s );
     protected int local_x;
     protected int local_y;
class Bezier
     public static final int DEFAULT_NUMBER_STEPS = 15;
     public Bezier ()
          a = b = c = d = null;
          steps = DEFAULT_NUMBER_STEPS;
     public Bezier ( XY start, XY one, XY two, XY end )
          setKnots ( start, one, two, end );
          steps = DEFAULT_NUMBER_STEPS;
     public Bezier ( XY start, XY one, XY two, XY end, int s )
          setKnots ( start, one, two, end );
          steps = s;
     public void setKnots ( XY start, XY one, XY two, XY end )
          a = start;
          b = one;
          c = two;
          d = end;
          e = null;
     public void addNext ( XY point, XY control )
          a = d;
          b = e;
          c = null; // 2d - e
          d = point;
          e = control;
     public void draw ( Graphics g, int t )
          float stepSize = 1/(float)steps;
          int ox = getX ( 0, t );
          int oy = getY( 0, t );
          for ( float i = 0; i<1; i+= stepSize )
               int x = getX ( i, t );
               int y = getY ( i, t );
               g.drawLine( ox, oy, x, y);
               ox = x;
               oy = y;
          g.drawLine ( ox, oy, d.x(t), d.y(t) );
     public int getX ( float mu, int t )
          double mum1,mum13,mu3;
          mum1 = 1 - mu;
          mum13 = mum1 * mum1 * mum1;
          mu3 = mu * mu * mu;
          int controlx = 0;
          if ( c != null )
               controlx = c.x(t);
          else if ( e != null )
               controlx = 2*(d.x(t)) - e.x(t);
          double x = mum13*a.x(t) +
          3*mu*mum1*mum1*b.x(t) +
          3*mu*mu*mum1*controlx +
          mu3*d.x(t);
          return (int) x;
     public int getY ( float mu, int t )
          double mum1,mum13,mu3;
          mum1 = 1 - mu;
          mum13 = mum1 * mum1 * mum1;
          mu3 = mu * mu * mu;
          int controly = 0;
          if ( c != null )
               controly = c.y(t);
          else if ( e != null )
               controly = 2*(d.y(t)) - e.y(t);
          double y = mum13*a.y(t) +
                    3*mu*mum1*mum1*b.y(t) +
                    3*mu*mu*mum1*controly +
                    mu3*d.y(t);
          return (int) y;
     int steps;
     XY a;
     XY b;
     XY c;
     XY d;
     XY e;
}

Similar Messages

  • How can i put a line like blue line in the file below which extends from the header to the footer.

    you see in the file below the blue line
    serparating the sidebar container and the main content container. thats
    what i need to do. if somebody help me with that i certainly would appreciatre that
    thank

    Equal height columns in CSS are best acheived with a background-image.  This is known as Faux Columns.
    Place a background-image in your #container division and repeat-y (down the page). The following background image is for a 3-column layout, but the same method can be used for 2-col, 4-col, etc...
    You can see the live page here:
    http://alt-web.com/TEMPLATES/3-col-white-gray.html
    View Page Source to see the HTML & CSS code.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • How can I get two lines mail list like Windows Live Mail and How can I get to, cc, bcc lines like Windows Live Mail?

    I wish to move Thunderbird. But i have two main problem.
    * I want two lines mail lis like Live Mail,
    * I want to, cc, bcc line like Live Mail. I mean when, I write an e-mail address I will key "," (or another character) then I will enter next email address. Auto address completion must work for each address which I enter the address line.
    Can i do those on Thunderbird?
    I searched on the internet and there are much people who want this features.
    Thanks..

    I see the dropdown menus for CC and BCC, but they don't work. I click on them and there is no response except the name I already had in the "TO" field disappears! The attached screenshots shows the name in the "to" field, then the result after choosing "add CC" - the "to" name disappears.

  • How can i produce this type of line chart (yield curve) by using flex2 charting?

    help! I am a flex newcomer, how can i produce this type of
    line chart (yield curve) by using flex2 charting? Anybody can teach
    me how can i customize the width of each scales as below of line
    chart? anybody know this?
    Click
    Here To See

    I need to show the X and Y Co-ordinate in a message when I click on the graphic's point.
    thanks for the tips, I´ll try to understand the sample program.
    Noguti

  • How to bend a line?

    Hello,
    All I want to do is bend a line.  I see that I can create a straight line, but is there an easy way to pull parts of the line to make it bendy or wavy?  It seems like a pretty simple feature to have, but I can't figure out how to do it!  Thanks in advanced.
    -TitanVex

    TitanVex,
    To a veritcal straight line, apply the shear filter.
    Filter>Distort>Shear
    If you need to make an arrowhead, not just a simple bend, select the line tool from the shape selection tool, and on the tool's option bar next to "weight" there is an icon. Click on it for the dialog to configure the arrow head.

  • IMac 8.1 3.06 GHz w/6 MB Ram, Lion and dead HD? all I get is "Gray Screen w/wirlie gig" but now for a new twist a circle with a diagonal line, like don't go. Is this a DEAD HD?

              I have a iMac 8.1 3.06 GHz w/6 MB Ram, and was running Mac OS X 10.6.8. My 500 GB WD5000AAKS was about 90% full. I had an issue with the admin password, it would not accept any of my known passwords. I ran for a while on the fingerprint reader I had, we have two users on the machine in our home. I tried many attempts to fix this problem without success I came up with a plan. That plan was a new HD, used a 2TB Samsung. plan worked like a charm. Installed a 4 GB Ram Chip and the new Samsung, formatted it, loaded Snow Leopard, and loaded what was on my Time Machine backup all was good.
              This was early July, then Lion was available I was happy with what I had, I had 1.450 TB of free space. So, what the heck, lets spring for Lion, that even went well for a not even 2 weeks, enough that I had several Time Machine backups.
               Then monitor goes flash, flash then I try a re-boot same gray screen with whirlie gig that I had when the the HD in my MacBook Pro died. Put the old 500 GB WD back in and all was fine, ran for a day. It was OK except back to no password and full. Went down to my local computer shops here in Rayong Thailand and sprung for a New 2 TB WDXXX, put that in, used my Snow Leopard disk to format and load OS X 10.6.8. I though that all was good, the load from Time Machine was slow and the time remaining was changing all the time, took about 3 hrs for about 300 MB that where on the LaCie.
              Now I have a password issue, however it asks for a password reset that it will NOT take and I don’t even get that now. All I get is the infamous “Gray Screen w/wirlie gig” but now for a new twist a circle with a diagonal line, like don’t go. Is this a DEAD HD? I plan to re-install the old 500GB just to systems check and if all is well I will take the “NEW” 2 TB WD back for replacement. I am thinking that I should put the new HD in and format and load Snow Leopard then up date to Lion then do my Time Machine backup. The only problem is does the circle with the diagonal line mean something more? If so how does one recover Lion with no disk if that is what I need to do. Yes, I have tried control “R” on boot, nadda, no response, “mai dee” no good. Ideas, please.

    I have an iMac 8, 1 that I upgraded Leopard to Snow Leopard.  It was totally updated with the latest from Apple when I bought and tried installing Lion.  The upgrade failed, shot my OS and I couldn't boot.  Had the constant spinner on a grey screen..  did a format of the drive, hdd repair and everything came back clean... got back to Snow Leopard and all the updates on it again and then retried the Lion thing... same bs... dead duck.  Crashed my system one too many times.  I can't see where a few small changes, mostly app related can be classified as an OS upgrade and is not compatible with my iMac.  I have the stuff running on my Mac Pro but have yet to notice anything impressive.  I've always used F3 and really didn't require Mission Control.  Just open you app folder for launch pad... duh?  I use the hot corners anyhow.  As far as Safari is concerned... as a power user, Apple missed the boat on that for me.. full screen etc.. Wow.  I don't like the new Mail either..
    As you can see/read, I'm less than impressed with this release from Apple but I own so many of their products that I will have to put up with it for now... somehow the MS logo should apply to this release Steve.

  • How can I make a line at 40 degree angle in Keynote 6

    How can you make a line of 40 degrees (or anywhere between 40 to 45) angle in the new Keynote 6.2.2. It seems they took away that nice feature from the previous version. When I move one end of a line, it locks onto 45 when I get near that angle, and jumps off directly to 34 when I try to move away. Previously you could click on a line to transform the ends into red spots, and move them independently to any angle or length. Now it locks onto 45, or 135 or 90 etc. I don't have any of the guides on or any other feature. This is supposed to happen only when holding shift key (which is also a great feature). If it locks onto the magic angles without holding shift, then there is no sense if having that feature at all.

    Press the command key when dragging, this switches off snapping and allows continuous placement.
    If you like numerical control:     Inspector > Format > Arrange > Rotate

  • How can I animate a line to show the creation of a circle?

    hello there, I need to animate a line to show the creation of a circle. This is very easy in powerpoint as I can decide how the line has to enter the slide. I cannot believe that captivate cannot do that.... any hints?

    Off the top of my head you can do this with 3 objects. The circle and two rectangles that will have motion path effect applied to them that will have an effect of wiping away and revealing the circle below. There's probably an easier way but like I said I just pulled this outa my...
    This will work nicely and cleanly in HTML5 since it's a simple motion path effect.
    The screenshot shows the two rectangles moving in opposite directions. The lower box should move AFTER the first one is done. I'm showing some transparency so you can see the circle below.

  • Can you change the line spacing in the legend?

    Is there a way to change the line spacing in the legend? I have a pie chart with text and I can't change the line spacing for its legend like you would in a regular text. Is there a way to change it?

    For space between each line, use the leading value in the Character pallet. For space between paragraphs, use the Space Before or Space After values in the Paragraph pallet.

  • Can I color a line of "standard text" in adobe forms output?

    Simple question: Can I color a line of "standard text" in adobe forms output?
    My standard text (SO10) has multiple lines. 
    Can I make one of the lines red?
    Ollie

    Hi Oliver,
    I believe you standard text is a table type of TDLINES.
    On the form you would display it with a table of 1 column 1 row with repeat row ticked.
    Have the like below code on the fomr ready event of your table.
    for(var i =0; i<this.Row1.nodes.length;i++)
         if(i == 1){
         this.Row1.Cell1.font.fill.color.value = "255,0,0";
         this.Row1.xx.font.fill.color.value = "255,0,0";
    Note: in my example I had a table with one row names Row1 and 2 fields cell1 type textbox,  & xx as text / label.
    If its like you have it in a text box with multiple entries, we need to spli the value such that 1st row is displayed in a text box whose parameters are by defeult set to font red, and rest of them to this text area.
    If your procedure is table the code sud work, else let me know how you get data and how do you display it on the screen.
    Cheers,
    Sai

  • How can I get a line installed at an earlier date?

    Hi,
    I'm moving into a second home in Poole Dorset next week and despite giving plenty of notice (3 weeks), Open Reach are not offering to arrive in time to install a new phone line while I'm there. 
    The current date I have from them is 9th August but I'm only at the property between 27th July and 4th August.
    Can anyone please assist with expediting my request?
    The installation has been arranged via Orange as they are providing the broadband service, so I don't have a direct number for Open Reach to see if they've had any cancellations or can fit me in.
    Many thanks
    David

    there is no direct number for openreach as you are not a client - openreach do not deal with public just service providers.  you need to go back to orange and see if they can help you
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • I can see scan (interlace) lines on my screen! and home dock flicker!

    Hi
    I have noticed looking at my iphone display i'm getting horizontal scan lines when I move my eyes from top to bottom of the display there very faint but annoying and seem to happen more on greys.
    I have noticed on full bright screen the gray band at the back of the iphone apps (the dock) on the home screen flickers rapidly like a 60hz crt monitor flicker.
    Is this normal or a defect?

    Yes no lighting nearby Its like my screens slower to refresh then my previous iphone its more easy to see when on full bright the display flickers towards the bottom on the grey band almost pulseing/shimmer just like a bad floresent tube!
    If I tip the phone the screen breaks into faint scan lines like them animated pictures u can get by tipping them!

  • Can i use this line in JNLP file?

    Can i use the below line in JNLP file?
    <property name="ondc.root" value="@user.dir"/>
    I want to get the client side location of a JAR file. How can i get it?
    plz help
    Thanks,
    Deepak

    I Think u can not use this line
    as i have studied jnlp file syntax thoruoghly and did not found any thing like this
    would u plz telll me what u want to aceive so that i can suggest u any solution.
    Regards
    M Fazal Ur Rehman(Pakistan)

  • Can we hide the lines between the columns and rows of an alv in wd abap

    HI all ,
      I know that we can colour cell/column/row in an alv in wd abap.
       but, can we hide the lines between the columns and rows of an alv in wd abap.
         i have checked this link [hiding lines b/n rows and columns of an  alv|http://help.sap.com/saphelp_nw04/helpdata/en/91/e7eb40c4f8712ae10000000a155106/content.htm]
         but didn't  understand, can please anybody provide some example or any material..? it will be very helpful.
                                                                         THANK  YOU.
    Edited by: arfat111 on Feb 15, 2010 7:05 AM

    Code some like this in the WDDOINIT method of your view which defines the ALV component as used component.
    instansiate the ALV component
    data lo_cmp_usage type ref to if_wd_component_usage.
    lo_cmp_usage = wd_this->wd_cpuse_usage_alv().
    if lo_cmp_usage->has_active_component() is initial.
       lo_cmp_usage->create_component().
    endif.
    data lo_interfacecontroller type ref to iwci_salv_wd_table.
    lo_interfacecontroller = wd_this->wd_cpifc_usage_alv().
    data lo_value type ref to cl_salv_wd_config_table.
    lo_value = lo_interfacecontroller->get_model().
    hide the grid lines
    lo_value->if_salv_wd_table_settings~SET_GRID_MODE( value = '01' ).
    Thanks,
    Abhishek

  • How can I disappear the lines of the grid from the picture?

    Please help!
    This photo was made through a grid.
    http://www.flickr.com/photos/apexivision/4468964280/sizes/o/in/photostream/
    My question is: how can I disappear the lines of the grid from the picture with Photoshop CS2?  Thanks!!!

    Select the offending parts with a fuzzy-edged selection and adjust the curves to get some relief.
    Then Burn and Dodge can be your friends as well.
    Some things that can help:  Make a duplicate layer so you have the original to compare against (and to go back to as needed.  Work in 16 bits / channel and (ideally) at an upsampled resolution.  Add a Curves adjustment layer above with the curves pulled up so you can lighten up the shadows as needed and see that you're getting things right even in the dark shadows.
    You may need to do some selective noise reduction in the places you've enhanced, as the lightening and darkening will bring up the noise.
    -Noel

Maybe you are looking for