Home > Community > Forums > Custom IC SKILL > Ongrid procedure

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Ongrid procedure 

Last post Mon, Oct 31 2011 3:31 AM by pdda. 2 replies.
Started by pdda 30 Oct 2011 01:48 AM. Topic has 2 replies and 1618 views
Page 1 of 1 (3 items)
Sort Posts:
  • Sun, Oct 30 2011 1:48 AM

    • pdda
    • Not Ranked
    • Joined on Tue, Nov 17 2009
    • Posts 9
    • Points 120
    Ongrid procedure Reply

     Hi,

    I want to know is there any procedure  to find whether given points are on grid or offgrid.If i give apoint like 0.625 and grid is 0.01 

    then the procedure should return "nil" .If i give point like 0.62 it should return "t".

    Filed under:
    • Post Points: 20
  • Mon, Oct 31 2011 2:19 AM

    • Lars E
    • Not Ranked
    • Joined on Mon, Jun 27 2011
    • Posts 1
    • Points 20
    Re: Ongrid procedure Reply

    procedure(gridp( point )             
      let((theGrid )
        theGrid = 0.01
        point/theGrid == round(point/theGrid)  
      )
    )

    Filed under:
    • Post Points: 20
  • Mon, Oct 31 2011 3:31 AM

    • pdda
    • Not Ranked
    • Joined on Tue, Nov 17 2009
    • Posts 9
    • Points 120
    Re: Ongrid procedure Reply

     Thank you very much .

    I also written some other function like this.It is also working fine.

    procedure(ongridp( value )
       let(()
         value_2 = round(value/0.01)*0.01
         value_3 = (value/0.01)*0.01
         value_4 = abs(value_2 - value_3)
         zerop(value_4)
    ))

     

    Filed under:
    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by pdda at 30 Oct 2011 01:48 AM. Topic has 2 replies.