master of computer application1

Upload: neera-tomar

Post on 14-Apr-2018

231 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Master of Computer Application1

    1/34

    Master of Computer Application (MCA) Semester 3

    MC0071 Software Engineering4 Credits

    (Book ID: B0808 & B0809)

    Q.1. explain iterative development model in detail.

    Ans: The iterative enhance model counters the third limitation of the waterfall model andtries to combine a benefit of both prototyping and the waterfall model. The basic idea is thatthe software should be developed in increments, each increment adding some functionalcapability to the system until the full system is implemented. At each step, extensions anddesign modifications can be made. An advantage of this approach is that it can result in bettertesting because testing each increment is likely to be easier than testing the entire system as in

    the waterfall model. The increment models provide feedback to the client i.e., useful fordetermining the final requirements of the system.

    In the first step of this model, a simple initial implementation is done for a subset of theoverall problem. This subset is one that contains some of the key aspects of the problem thatare easy to understand and implement and which form a useful and usable system.

    Each step consists of removing the next task from the list, designing the implementation forthe selected task, coding and testing the implementation, performing an analysis of the partialsystem obtained after this step, and updating the list as a result of the analysis.

    The iterative enhancement model

    The project control list guides the iteration steps and keeps track of all tasks that must bedone. Based on the analysis, one of the tasks in the list can include redesign of defectivecomponents or redesign of the entire system. Redesign of the system will occur only in theinitial steps. In the later steps, the design would have stabilized and there is less chance ofredesign. One effective use of this type of model is for product development, in which thedevelopers themselves provide the specifications and therefore have a lot of control on whatspecifications go in the system and what stay out.

    In a customized software development, where the client has to essentially provide andapprove the specifications, it is not always clear how this process can be applied. Another

    practical problem with this type of development project comes in generating the businesscontract-how will the cost of additional features be determined and negotiated, particularlybecause the client organization is likely to be tied to the original vendor who developed thefirst version.

    Q.2. Describe the Object Interface Design.

    Ans. Object Interface Design

    Object Interface design is concerned with specifying the detail of the object interfaces. Thismeans defining the types of the object attributes and the signatures and the semantics of theobject operations.

  • 7/30/2019 Master of Computer Application1

    2/34

    Designers should avoid interfaces representation information in their interface design. Rather,the representation should be hidden and object operations provided to access and update thedata.

    Design evolution

    An important advantage of an object-oriented approach to design is that it simplifies theproblem of making changes to the design. The reason for this is that object staterepresentation does not influence the design. Changing the internal details of an object isunlikely to affect any other system objects .

    New objects to support pollution monitoring

    (1) An object Air quality should be introduced as part of Weather station at the same level asWeather data.

    (2) An operation Transmit pollution data should be added to Weather station to send thepollution information to the central computer. The weather station control software must bemodified so that pollution readings are automatically collected when the system is switched

    on.

    (3) Objects representing the types of pollution, which can be monitored, should be added.Levels of nitrous oxide, smoke and benzene can be measured.

    (4) A hardware control object Air quality meter should be added as a sub-object to Airquality. This has attributes representing each of the types of measurement, which can bemade.

    Function oriented design

    Function-oriented has been practiced informally since programming began. Programs weredecomposed into subroutines, which were functional in nature. In the late 1960s and early1970s several books were published which described top-down functional design. They

  • 7/30/2019 Master of Computer Application1

    3/34

    specifically proposed this as a structured design strategy. These led to the development of

    many design methods based on functional decomposition.

    The functional design of software for an ATM

    In this design, the system is implemented as a continuous loop and actions are triggered whena card is input. As object-oriented design has become more widely used, some people havesuggested that Function-oriented design is obsolete, and should be superseded by an object-oriented approach.

    The activities of Function-oriented design are:

    (1) Data-flow design (2) Structural decomposition (3) Detailed design descriptionAs with all design processes, these activities are not carried out in sequence but areinterleaved during the design process.

    Q. 3. Explain why it is important to describe software designs.

    Ans : Software Design

    Any design problem must be tackled in three stages:

    (1) Study and understand the problem without understanding effective software design isimpossible. The problem should be examined from a number of different angles orviewpoints as these provide different insights into the design requirements.(2) Identify gross features of at least one possible solution . It is often useful to identify anumber of solutions and to evaluate them all. The choice of solution depends on the

    designers experience, the availability of reusable components, and the simplicity of thederived solutions.(3) Describe each abstraction used in the solution. Before creating formal documentation,the designer may write an informal design description

    The design process

    A general model of a software design is a directed graph. The target of the design process isthe creation of such a graph without inconsistencies.

    The progression from an informal to a detailed design

    These design activities are:

    (1) Architectural designs (2) Abstract specification (3) Interface design(4) Component design (5) Data structure design (6) Algorithm design

    This process is repeated for each sub-system until the components identified can be mappeddirectly into programming language components such as packages, procedures or functions.

    Design Methods

    A mathematical method (such as the method for long division) is a strategy that will alwayslead to the same result irrespective of who applies the method. A structured method includes

  • 7/30/2019 Master of Computer Application1

    4/34

    a set of activities, notations, report formats, rules and design guidelines. So structuredmethods often support some of the following models of a system:

    (1) A data-flow model (2) An entity-relation model (3) A structural (4) If the methodis object-oriented it will include an inheritance model of the system

    Particular method supplement these with other system models such as state transitiondiagrams, entity life histories that show how each entity is transformed as it is processed andso on.

    Design description

    A software design is a model system that has many participating entities and relationships.Designs are documented in a set of design documents that describes the design for

    programmers and other designers. There are three main types of notation used in designdocuments:

    (1)Graphical notations (2) Program description languages (3) Informal textDesign strategies

    In an object-oriented design, the System State is decentralized and each object manages itsown state information.

    Q. 4. Write an overview on the Rational Unified Process

    Ans: Rational Unified Process Model (RUP)

    UML has become a widely accepted, standard notation for object-oriented architecture anddesign. The widespread acceptance of UML allows developers to perform system design and

    provide design documentation in a consistent and familiar manner

    Myriad sources of information about the Rational approach are available in books and on theInternet. This development product is widely used, especially for e-business applications.Krutchen (2003) provides an excellent overview of the approach and its software engineeringmotivations.

    Therational unified process(RUP) is built around visual software support for what itsdesigners believe are the essentialbest practicesfor effective software development, namely:

    Iterative development.The iterative, Boehm-style, spiral approach is intended to mitigatedevelopment risk by using a combination of early implementation and requirements testing

    and modification in order to expose requirements errors early.Use of component-based software architectures.Component-based development allows theuse (or reuse) of commercially available system

    Use of tools that support visual design of the system, continuous verification, and changemanagement.

    Intelligently designed visual modeling tools help manage and share development artifacts,

    The RUP constitutes a complete framework for software development. The elements of theRUP (not of the problem being modeled) are theworkers who implement the development,

  • 7/30/2019 Master of Computer Application1

    5/34

    RUP recommends a so-called 4 + 1 view of architecture. The logical view addressesfunctional requirements. The implementation view addresses the software moduleorganization and issues such as reuse and off-the-shelf components.

    The RUP is driven by use cases that are used to understand a problem in a way accessible todevelopers and users. Ause casemay be defined as a sequence of actions a system performs

    The flow of events that transpires might be as follows:

    1. (User): insert the bank card for the ATM to read and validate

    2. (System): prompt user for personal PIN number, which the user enters and the systemvalidates

    3. (System): prompt user for requested services, such as withdrawal

    4. (System): request amount to withdraw, user enters amount

    5. (System): request account type, user selects a type such as checking

    6. (System): perform validation of request for ID, PIN, amount, and type through the ATMnetwork

    7. (System): query user for receipt

    8. (System): tell user to remove card, verify removal

    9. (System): dispense cash requested

    10. (System): optionally print receipt

    Q.5. Describe the Capability Maturity Model.

    Ans:The Capability Maturity Model

    TheCapability Maturity Model(CMM) is a multistage, process definition model intended tocharacterize and guide the engineering excellence or maturity of an organizations softwaredevelopment processes. TheCapability Maturity Model: Guidelines for Improving theSoftware Process(1995) contains an authoritative description. See also Paulk et al. (1993)and Curtis, Hefley, and Miller (1995) and, for general remarks on continuous processimprovement, Somerville, Sawyer, and Viler (1999)

    The model prescribes practices for planning, engineering, and managing software

    development and maintenance and addresses the usual goals of organizational systemengineering processes: namely, quality improvement, risk reduction, cost reduction,

    Atlevel 1,the organizations software development follows no formal developmentprocess.

    The process maturity is said to be atlevel 2if software management controls have beenintroduced and some software process is followed.

    refers to the processes used to keep track of the changes made to the development product(including all the intermediate deliverables) and the multifarious impacts of these changes.

    These impacts range from the recognition of development problems; identification of theneed for changes; alteration of previous work; verification that agreed upon modifications

  • 7/30/2019 Master of Computer Application1

    6/34

    have corrected the problem and that corrections have not had a negative impact on other partsof the system; etc.

    An organization is said to be atlevel 3if the development process isstandard andconsistent.The project management practices of the organization are supposed to have beenformally agreed on,defined,and codified at this stage of process maturity.

    Organizations atlevel 4are presumed to have put into place qualitative and quantitativemeasures of organizational process. These processmetricsare intended to monitordevelopment and to signal trouble and indicate where and how a development is going wrongwhen problems occur.

    Organizations at maturitylevel 5are assumed to have established mechanisms designed toensure continuous process improvement and optimization. The metric feedbacks at this stageare not just applied to recognize and control problems with the current project as they were inlevel-4 organizations. They are intended to identify possible root causes in the process thathave allowed the problems to occur and to guide the evolution of the process so as to prevent

    the recurrence of such problems in future projects, such as through the introduction ofappropriate new technologies and tools.

    The higher the CMM maturity level is, the more disciplined, stable, and well-defined thedevelopment process is expected to be and the environment is assumed to make more use ofautomated tools and the experience gained from many past successes (Zhiying 2003). The

    staged character of the model lets organizations progress up the maturity ladder by settingprocess targets for the organization. Each advance reflects a further degree of stabilization ofan organizations development process, with each level institutionaliz[ing] a different

    aspect of the process (Oshana&Linger 1999).

    Each CMM level has associatedkey process areas(KPA) that correspond to activities that

    must be formalized to attain that level. For example, the KPAs at level 2 includeconfiguration management, quality assurance, project planning and tracking, and effectivemanagement of subcontracted software. The KPAs at level 3 include intergroupcommunication, training, process definition, product engineering, and integrated softwaremanagement. Quantitative process management and development quality define the requiredKPAs at level 4. Level 5 institutionalizes process and technology change management andoptimizes defect prevention.

    The CMM model is not without its critics. For example, Hamlet and Maybee (2001) object toits overemphasis on managerial supervision as opposed to technical focus. They observe thatagreement on the relation between the goodness of a process and the goodness of the product

    is by no means universal. They present an interesting critique of CMM from the point of viewof the so-calledprocessversus product controversy. The issue is to what extent softwareengineers should focus their efforts on the design of the software product being developed asopposed to the characteristics of the software process used to develop that product.

    The usual engineering approach has been to focus on the product, using relativelystraightforward processes, such as the standard practice embodied in the Waterfall Model,adapted to help organize the work on developing the product. A key point of dispute is thatno one has really demonstrated whether a good process leads to a good product. Indeed, good

    products have been developed with little process used, and poor products have beendeveloped under the guidance of a lot of purportedly good processes. Furthermore, adopting

    complex managerial processes to oversee development may distract from the underlyingobjective of developing a superior product.

  • 7/30/2019 Master of Computer Application1

    7/34

    Hamlet and Maybee (2001) agree that, at the extremes of project size, there is no particularargument about the planning process to follow. They observe that for small-scale projects, thecost of a heavy process management structure far outweighs the benefits; however, for verylarge-scale projects that will develop multimillion-lines systems with long lifetimes,significant project management is clearly a necessity. However, in the midrange of projects

    with a few hundred thousand lines of code, the trade-offs between the managed model ofdevelopment and the technical model in which the management hierarchy is kept to an

    absolute minimum are less obvious; indeed, the technical model may possibly be the superiorand more creative approach.

    Bamberger (1997), one of the authors of the Capability Maturity Model, addresses what shebelieves are some misconceptions about the model. For example, she observes that themotivation for the second level, in which the organization must have a repeatable software

    process, arises as a direct response to the historical experience of developers when their

    software development is out of control (Bamberger 1997). Often this is for reasons having

    to do with configuration management or mismanagement! Among the many symptoms of

    configuration mismanagement are: confusion over which version of a file is the currentofficial one; inadvertent side effects when repairs by one developer obliterate the changes ofanother developer; inconsistencies among the efforts of different developers; etc.

    A key appropriate response to such actual or potential disorder is to get control of the productand the product pieces under development (configuration management) by (Bamberger

    1997):

    Controlling the feature set of the product so that the impact/s of changes are more fullyunderstood (requirements management)

    Using the feature set to estimate the budget and schedule while leveraging as much past

    knowledge as possible (project planning) Ensuring schedules and plans are visible to all the stakeholders (project tracking)

    Ensuring that the team follows its own plan and standards and corrects discrepancies when

    they occur (quality assurance)

    Bamberger contends that this kind of process establishes the basic stability and visibilitythat are the essence of the CMM repeatable level.

    6. Explain the round-trip problem solving approach.

    The software engineering process represents around-trip frameworkfor problem solving in a

    The software engineering process is a problem-solving process entailing that softwareengineering should incorporate or utilize the problem-solving literature regardless of itsinterdisciplinary sources.

    The value of software engineering derives from its success in solving business and humanproblems. This entails establishing strong relationships between the software process and thebusiness metrics used to evaluate business processes in general.

    The software engineering process is a round-trip approach. It has a bidirectional character,which frequently requires adopting forward and reverse engineering strategies to restructure

    and reengi-neer information systems. It uses feedback control loops to ensure that

  • 7/30/2019 Master of Computer Application1

    8/34

    specifications are accurately maintained across multiple process phases; reflective qualityassurance is a critical metric for the process in general.

    The nonterminating, continuing character of the software development process is necessaryto respond to ongoing changes in customer requirements and environmental pressures.

    0072

    Explain Bresenhams Circle Drawing Algorithm.

    Bresenhams Circle Drawing Algorithm

    The Bresenhams circle drawing algorithm considers the eight-way symmetry of the circle togenerate it. It plots 1/8thpart of the circle, i.e. from 900to 450as shown in the fig 3.15. Ascircle is drawn from 900to 450, the x moves in positive direction and y moves in thenegative direction.

    To achieve best approximation to the true circle we have to select those pixels in the rasterthat fall the least distance from the true circle. Refer

    Fig. 3.16. Let us observe the 900to 450portion of the circle. It can be found by applyingeither of the two options:

    Increment in positive x direction by one unit or

    Increment in positive x direction and negative y direction both by one unit

    Fig. 3.16: Scan conversion with Bresenhams algorithm

    Let us assume point P in Fig.3.16 as a last scan converted pixel. Now we have two optionseither to choose pixel A or pixel B. The closer pixel amongst these two can be determined asfollows

    The distances of pixels A and B from the origin are given as

    http://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image139.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image139.jpg
  • 7/30/2019 Master of Computer Application1

    9/34

    DA= and

    DB=

    Now, the distances of pixels A and B from the true circle are given as

    and

    However, to avoid square root in derivation of decision variable, i.e. to simplify the

    computation and to make algorithm more efficient the and

    Q2. Derive the matrix for inverse transformation.

    6.3.6 Inverse Transformations

    When we apply any transformation to point (x, y) we get a new point . Sometimes it

    may require to undo the applied transformation. In such a case we have to get original point

    (x, y) from the point . This can be achieved by inverse transformation. The inversetransformation uses the matrix inverse of the transformation matrix to get the original point(x, y). The inverse of a matrix is another matrix such that when the two are multipliedtogether, we get the identity matrix.

    TT1 = T1 T = I (6.20)

    Where I is the identity matrix with all elements along the major diagonal having value 1, andall other elements having value zero.

    The element for the inverse matrix T1 can be calculated from the elements of T as

    (6.21)

    Where is the element in the ith row and jth column of T1, and Mji is the (n1) by (n 1) submatrix obtained by deleting the jth row and ithcolumn of the matrix A. The detMji and det T is the determinant of the Mjiand T matrices.

    The determinant of a 2 2 matrix is

    (6.22)

    The determinant of a 3 3 matrix is

    (6.23)

    In general form, the determinant of T is given by

    (6.24)

    Where Mij is the submatrix formed by deleting row i and column j from matrix T. The

    inverse of the homogeneous coordinate transformation matrix can be given as

    http://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2381.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2361.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2341.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2321.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2302.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2281.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2261.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1514.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image149.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image147.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1451.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image1431.gif
  • 7/30/2019 Master of Computer Application1

    10/34

    It is important to note that the elements of inverse matrix T1 can be calculated from theelement of T as

    (6.25)

    In the above equation the term det T is in the denominator. Hence, we can obtain an inversematrix if and only if the determinant of the matrix is nonzero.

    Q 3. Discuss the following Raster Graphic Algorithms:

    Digital Differential Analyzer (5)

    Ans. We know that the slope of a straight line is given as

    m = ... (1)

    The above differential equation can be used to obtain a rasterized straight line. For any givenx interval ?x along, a line, we can compute the corresponding y interval ?y from equation (1)as

    (2)

    Similarly, we can obtain the x interval ?x corresponding to a specified ?y as

    (3)

    Once the intervals are known the values for next x and next y on the straight line can beobtained as follows

    xi+1= xi+?x

    = + ( 4)

    And

    yi+1=yi+?y

    = + (5)

    The equations 4 and 5 represent a recursion relation for successive values of x and y alongthe required line. Such a way of rasterizing a line is called adigital differential

    analyzer(DDA). For simple DDA either , whichever is larger, is chosen as oneraster unit, i.e.

    http://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0289.jpghttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0269.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0246.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0225.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02017.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01813.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01614.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01417.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2422.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image2401.gif
  • 7/30/2019 Master of Computer Application1

    11/34

    if then

    Else

    With this simplification if then we have

    = + and

    If then we have

    and

    = +

    Midpoint Line Drawing Algorithm (5)

    Ans. Midpoint circle drwing algorithm

    Consider the line in Fig.3.11, where the previously selected pixel appears as a filled circle

    and the two pixels from which to choose at the next stage are shown as unfilled circles.Assume that we have just selected the pixel P at (xp, yp) and now we have to select betweenthe pixel one increment to the right (B) or the pixel one increment to the right and oneincrement up (A). The C is the intersection of the line being scan converted with the grid linex=xp+1.

    In Bresenhams algorithm the difference between the vertical distances from A and B to C is

    calculated, and the sign of the difference is used to select the pixel whose distance from C issmaller as the best approximation to the line. In the midpoint algorithm, we find on whichside of the line the midpoint lies. Then it is easy to see that, if the midpoint lies above theline, pixel B is closer to the line, if the midpoint lies below the line, pixel A is closer to theline. In our case, the midpoint lies below the line and hence pixel A is closer to the line.

    http://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02211.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02018.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0463.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03711.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0442.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0423.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02612.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02411.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0397.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0374.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03214.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image0347.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03213.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image03012.gif
  • 7/30/2019 Master of Computer Application1

    12/34

    From above explanation we can realize that we have to calculate on which side of the line themidpoint lies. The slope intercept form of line can be given as

    y=mx+C;

    Where m= and C is the y intercept

    y= x + C

    F(x,y)=dy. x - dx. y+ C. dx=0

    =ax+by+c

    where a =dy, b=- dx, and c= C. dx

    The F(x,y) is zero on the line, positive for points below for the line, and negative for points

    above the line. Therefore, to apply the midpoint criterion, we have only to computeF(m)=F(xp+1,yp+1/2) and to test its sign. The result of the computation F(m) gives thedecision, hence it is denoted as d (decision variable). By definition d can be given as d=a(xp+1,)+b(yp+1/2)+c. if d>0, we choose pixel A, d

  • 7/30/2019 Master of Computer Application1

    13/34

    And

    F(x1+1,y1+1/2)= a(x1+1)+b(y1+1/2)+c

    =ax1+a+by1+b/2+c

    =ax1+by1+a+b/2+c=F(x1,y1)+a+b/2

    But point (x1,y1) is on the line and therefore F(x1,y1) is 0.

    F(x1+1,y1+1/2)=a+b/2

    dinitial=a+b/2=dy-dx/2

    To avoid the fraction term in the initial d value, the original F is multiplied by 2.

    F(x, y)=2(ax + by + c). This multiplies each constant and the decision variable by 2, but doesnot affect the sign of the decision variable.

    dinitial=2(dy-dx/2)=2dy-dx

    Q

    4. Explain the Polygon Seed Filling Algorithms:

    a. Boundary Fill algorithm (5)

    ANS; 4.4.1.1 Boundary Fill algorithm

    In this method edges of a polygon are drawn. Then starting with some seed (point) , any pointinside the polygon we examine the neighboring pixels to check whether the boundary pixel is

    reached. If boundary pixels are not reached, pixels are highlighted and the process iscontinued until boundary pixels are reached.

    Boundary defined regions may be either 4-connected or 8-connected as shown in the fig 4.14.if a region is 4-connected, then every pixel in the region may be reached by a combination ofmoves in only 4 directions: left, right, up and down. For an 8-connected region every pixel inthe region may be reached by a combination of moves in the 2 horizontal, 2 vertical and 4diagonal directions

    In some cases, an 8-connected algorithm is more accurate than the 4-connected algorithm. This is illustrated in fig 4.15. here a 4-connected algorithm producesthe partial fill.

  • 7/30/2019 Master of Computer Application1

    14/34

    Partial filling resulted using 4-connected algorithm

    Procedure: boundary_fill(x,y,f_color,b_color)

    {

    If(getpixel(x,y)!=b_color && getpixel(x,y)!=f_color){

    Putpixel(x,y,f_color)

    Boundaryfill(x+1, y, f_color, b_color)

    Boundaryfill(x, y+1, f_color, b_color)

    Boundaryfill(x-1, y, f_color, b_color)

    Boundaryfill(x, y-1, f_color, b_color)

    }}

    getpixel()gives the color of specified pixel andputpixel()draws the pixel with specifiedcolor.

    Qb.Flood Fill algorithm (5)

    ANS. Flood Fill algorithm

    Sometimes it is required to fill an area that is not defined within a single color boundary. In

    such cases we can fill areas by replacing a specified interior color instead of searching for aboundary color. This approach is called flood fill algorithm. Here we start with some seedand examine the neighboring pixels. However, here pixels are checked for a specified interiorcolor instead of a boundary color. And they are replaced by new color. Using either a 4-connected or 8-connected approach we can step through pixel positions until all interior

    points have been filled. The following procedure illustrates the recursive method for filling 8-connected region using flood fill algorithm

    Procedure: flood_fill(x,y,old_color, new_color)

    {

    If (getpixel(x,y)=old_color))

    {

    putpixel(x,y,new_color)

    flood_fill(x+1, y, old_color, new_color)

    flood_fill(x-1, y, old_color, new_color)

    flood_fill(x, y+1, old_color, new_color)

    flood_fill(x, y-1, old_color, new_color)

    flood_fill(x+1, y+1, old_color, new_color)

  • 7/30/2019 Master of Computer Application1

    15/34

    flood_fill(x-1, y-1, old_color, new_color)

    flood_fill(x+1, y-1, old_color, new_color)

    flood_fill(x-1, y+1, old_color, new_color)

    }}

    5. Describe the following Line Clipping Algorithms:

    a. Sutherland and Cohen Subdivision Line Clipping Algorithm (5)

    ans: This is one of the oldest and most popular line clipping algorithm developed by DanCohen and Ivan Sutherland. To speed up the processing this algorithm performs initial teststhat reduce the number of intersections that must be calculated. This algorithm uses a fourdigit (bit) code to indicate which of nine regions contain the end point of line. The four bitcodes are calledregion codesoroutcodes. These codes identify the location of the pointrelative to the boundaries of the clipping rectangle as shown in the

    Four-bit codes for nine regions

    Each bit position in the region code is used to indicate one of the four relative coordinatepositions of the point with respect to the clipping window: to the left, right, top or bottom.The rightmost bit is the first bit and the bits are set to 1 based on the following scheme:

    Set Bit 1if the end point is to theleftof the window

    Set Bit 2if the end point is to therightof the window

    Set Bit 3if the end point isbelowthe window

    Set Bit 4if the end point isabovethe window

    Otherwise, the bit is set to zero.

    Once we have established region codes for all the line endpoints, we can determine whichlines are completely inside the clipping window and which are clearly outside. Any lines thatare completely inside the window boundaries have a region code of 0000 for both endpointsand we trivially accept these lines. Any lines that have a 1 in the same bit position in the

    region codes for each endpoint are completely outside the clipping rectangle, and we triviallyreject these lines. A method used to test lines for total clipping is equivalent to the logical

  • 7/30/2019 Master of Computer Application1

    16/34

    AND operator. If the result of the logical AND operation with two end point codes is not0000, the line is completely outside the clipping region. The lines that cannot be identified ascompletely inside or completely outside a clipping window by these tests are checked forintersection with the window boundaries.

    Ex:Consider the clipping window and the lines shown in Fig. 5.4. Find the region codes foreach end point and identify whether the line is completely visible, partially visible orcompletely invisible.

    b. Generalized Clipping with Cyrus-beck Algorithm (5)

    The algorithms explained above assume that the clipping window is a regular rectangle.These algorithms are not applicable for non rectangular clipping windows. Cyrus and Beckhave developed a generalized line clipping algorithm. This algorithm is applicable to anarbitrary convex region. This algorithm uses a parametric equation of a line segment to findthe intersection points of a line with the clipping edges. The parametric equation of a linesegment from P1to P2is

    P(t) = P1+ (P2- P1)t ;0< t

  • 7/30/2019 Master of Computer Application1

    17/34

    Then P(t)f is pointed parallel to the plane containing f and perpendicular to the normal.

    3. If dot product is positive, i.e.

    n. [P(t)f] > 0

    Then the vector P(t)f is pointed towards the interior of R, as shown in fig.

    6. Discuss the Transformation from World Coordinate to Viewing Coordinates.

    Transformation from World Coordinate to Viewing Coordinates

    The conversion of object description from world coordinates to viewing coordinates isachieved by following transformation sequence.

    1. Translate the view reference point to the origin of the world coordinate system.

    2. Apply rotations to align the xv, yv, and zvaxes with worked coordinate xw, yw, zwaxes,respectively.

    The view point specified at world position (xp, yp, zp) can be translated to the worldcoordinate origin with the matrix transformation

    Aligning of viewing and world coordinate axes using a sequence of translate-rotatetransformations

    therefore, the composite transformation matrix is given as

    Tc= T.Rx. Ry. Rz

    There is another way to generate composite rotation matrix. A composite rotation matrix canbe directly generated by calculating unit u, v, n vectors. If we know N and V vectors, thevectors are calculated as

    http://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02020.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01816.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02020.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01816.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02020.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01816.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image02020.gifhttp://edunxt.smude.edu.in/FileRepository/Community/918/Slm%20Unit/clip-image01816.gif
  • 7/30/2019 Master of Computer Application1

    18/34

    This method of generating composite rotation matrix automatically adjusts the direction of Vso that v is perpendicular to n. The composite rotation matrix for the viewing transformationis given as

    This transforms u onto the world Xwaxis, v onto ywaxis, and n onto the zwaxis.Furthermore, this matrix automatically performs the reflection necessary to transform a left-handed viewing system onto the right handed world system.

    With second method, the composite transformation matrix is given asT0= T.R

    0073

    1. What is CISC & RISC? Explain their addressing modes.

    Ans. CISC

    A ComplexInstruction SetComputer (CISC) supplies a large number of complex instructionsat theassembly languagelevel.Assembly languageis a low-levelcomputerprogramminglanguage in which each statement corresponds to a single machineinstruction. CISC instructions facilitate the extensive manipulation of low-levelcomputational elements and events such asmemory,binary arithmetic, and addressing. Thegoal of the CISC architectural philosophy is to make microprocessors easy and flexible to

    program and to provide for more efficient memory use.

    The CISC philosophy was unquestioned during the 1960s when the early computingmachines such as the popularDigital Equipment CorporationPDP 11 family ofminicomputers were being programmed in assembly language and memory was slow andexpensive.

    CISC machines merely used the then-available technologies to optimize computer

    performance. Their advantages included the following: (1) A new processordesigncouldincorporate the instruction set of its predecessor as a subset of an ever-growing language--noneed to reinvent the wheel, code-wise, with each design cycle. (2) Fewer instructions wereneeded to implement a particular computing task, which led to lower memory use for

    program storage and fewer time-consuming instruction fetches from memory. (3) Simplercompilers sufficed, as complex CISC instructions could be written that closely resembled theinstructions of high-level languages. In effect, CISC made a computer's assembly languagemorelikeahigh-level languageto begin with, leaving thecompilerless to do.

    Some disadvantages of the CISC design philosophy are as follows: (1) The first advantagelisted above could be viewed as a disadvantage. That is, the incorporation of older instructionsets into new generations of processors tended to force growing complexity. (3) Manyspecialized CISC instructions were not used frequently enough to justify their existence. The

  • 7/30/2019 Master of Computer Application1

    19/34

    existence of each instruction needed to be justified because each one requires the storage ofmore microcode at in thecentral processing unit(the final and lowest layerofcodetranslation), which must be built in at some cost. (4) Because each CISC commandmust be translated by the processor into tens or even hundreds of lines of microcode, it tendsto run slower than an equivalent series of simplercommandsthat do not require so much

    translation. All translation requires time. (4) Because a CISC machine builds complexity intothe processor, where all its various commands must be translated into microcode for actualexecution, the design of CISChardwareis more difficult and the CISC design cyclecorrespondingly long; this means delay in getting to market with a new chip.

    The terms CISC andRISC(Reduced Instruction Set Computer) were coined at this time toreflect the widening split in computer-architectural philosophy.

    What is RISC?

    TheReduced Instruction Set Computer, orRISC, is a microprocessor CPU design philosophythat favors a simpler set of instructions that all take about the same amount of time to

    execute. The most common RISC microprocessors are AVR, PIC, ARM, DEC Alpha, PA-RISC, SPARC, MIPS, and IBM's PowerPC.

    Addressing Modes of CISC

    The 68000 addressing (Motorola) modes

    Register to Register,

    Register to Memory,

    Memory to Register, and

    Memory to Memory

    68000 Supports a wide variety of addressing modes.

    Immediate mode- the operand immediately follows the instruction

    Absolute address the address (in either the "short" 16-bit form or "long" 32-bit form) ofthe operand immediately follows the instruction

    Program Counter relative with displacement A displacement value is added to theprogram counter to calculate the operand's address. The displacement can be positive ornegative.

    Program Counter relative with index and displacement The instruction contains both the

    identity of an "index register" and a trailing displacement value. The contents of the indexregister, the displacement value, and the program counter are added together to get the finaladdress.

    Register directThe operand is contained in an address or data register.

    Address register indirectAn address register contains the address of the operand.

    Address register indirect with predecrement or postdecrementAn address register containsthe address of the operand in memory. With the predecrement option set, a predeterminedvalue is subtracted from the register before the (new) address is used. With the postincrementoption set, a predetermined value is added to the register after the operation completes.

  • 7/30/2019 Master of Computer Application1

    20/34

    Address register indirect with displacement --- A displacement value is added to theregister's contents to calculate the operand's address. The displacement can be positive ornegative.

    Address register relative with index and displacement --- The instruction contains both theidentity of an "index register" and a trailing displacement value. The contents of the indexregister, the displacement value, and the specified address register are added together to getthe final address.

    2.3.2 Addressing Modes for the Intel 80x86 Architecture

    Simple Addressing Modes (3)

    - Immediate Mode : operand is part of the instruction

    Example: mov ah, 09h

    mov dx, offset Prompt

    - Register Addressing : operand is contained in register

    Example: add ax, bx

    - Direct : operand field of instruction contains effective address

    Example: add ax, a

    Register Indirect Modecontents of register is effective address

    2. Discuss the following:

    a. Design Specification of Assembler (5)

    ans; There are six steps to be followed in the design of assembler. They are:

    1. Specify the problem.

    2. Specify data structures

    3. Define format of data structures.

    4. Specify algorithm

    5. Look for modularity. (Capability of one program to be subdivided into independentprogramming units).

    6. Repeat 1 through 5 on each module.

    In thefirst stepwe have to specify the function the assembler has to perform. Thesecondstepspecifies the data the assembler needs to perform in further operations. This will bestored in the form of tables, which is called as database (data structure). Thus the assemblermakes use of the information, which is present in the database for further processing. Inthethird stepwe specify the structure or the way data has to be stored in the database. Itspecifies the format of storing of data, and the contents of the database. The fourth stepgivesthe algorithm, which has to be converted to program to get the result from the assembler.Thefifth stepis the step for dividing the program into sub problems, which enables the

  • 7/30/2019 Master of Computer Application1

    21/34

    designer to write the assembler efficiently.Finallythe same steps have to be repeated for thesub problems, which have been divided from the given program.

    Design of Single Pass Assembler (5)

    Ans. Single pass translation

    LC processing and construction of the symbol table proceed as in two pass translation. Theproblem of forward references is tackled using a process calledbackpatch-ing.The operandfield of an instruction containing a forward reference is left blank initially. The address of theforward referenced symbol is put into this field when its definition is encountered.

    Look at the following instructions:

    START101

    READ N 101) + 09 0113

    MOVER BREG,ONE

    102) + 04 2115

    MOVEM BREG,TERM

    103) + 05 2116

    AGAIN MULT BREG,TERM

    104) + 03 2116

    MOVER CREG,TERM

    105) + 04 3116

    ADD CREG,ONE

    106) + 01 3115

    MOVEM CREG,TERM

    107) + 05 3116

    COMP CREG, N 108) + 06 3113

    BC LE,AGAIN

    109) + 07 2104

    MOVEM BREG, 110) + 05 2

  • 7/30/2019 Master of Computer Application1

    22/34

    RESULT 114

    PRINT RESULT 111) + 10 0114

    STOP 112) + 00 0000

    N DS 1 113)

    RESULT DS 1 114)

    ONE DC 1 115) + 00 0

    001

    TERM PS 1 116)

    END

    Fig. 1.7

    In the above program (fig. 1.7) , the instruction corresponding to the statement

    MOVER BREG, ONE

    can be only partially synthesized since ONE is a forward reference. Hence the instructionopcode and address of BREG will be assembled to reside in location 101. The need forinserting the second operand's address at a later stage can be indicated by adding an entry tothe Table of Incomplete Instructions (TII). This entry is a pair (instruction address>,), e.g. (101, ONE) in this case.

    By the time the END statement is processed, the symbol table would contain the addresses ofall symbols defined in the source program and TII would contain information describing allforward references. The assembler can now process each entry in TII to complete theconcerned instruction. For example, the entry (101, ONE) would be processed by obtaining

    the address of ONE from symbol table and inserting it in the operand address field of theinstruction with assembled address 101. Alternatively, entries in TII can be processed in anincremental manner. Thus, when definition of some symbolsymb is encountered, all forwardreferences to symb can be processed.

    3. Discuss the following:

    a. Macro Parameters (5)

  • 7/30/2019 Master of Computer Application1

    23/34

    ans: Macros may have any number of parameters, as long as they fit on one line. Parameternames are local symbols, which are known within the macro only. Outside the macro theyhave no meaning!

    Syntax:

    MACRO .

    .

    .

    ENDM

    Valid macro arguments are

    1. arbitrary sequences of printable characters, not containing blanks, tabs, commas, orsemicolons

    2. quoted strings (in single or double quotes)

    3. Single printable characters, preceded by '!' as an escape character

    4. Character sequences, enclosed in literal brackets < ... >, which may be arbitrary sequencesof valid macro blanks, commas and semicolons

    5. Arbitrary sequences of valid macro arguments

    6. Expressions preceded by a '%' character

    During macro expansion, these actual arguments replace the symbols of the correspondingformal parameters, wherever they are recognized in the macro body. The first argumentreplaces the symbol of the first parameter, the second argument replaces the symbol of thesecond parameter, and so forth. This is called substitution.

    b. Nested and Recursive Macro Calls and its expansion (5)

    ans: Macro bodies may also contain macro calls, and so may the bodies of those calledmacros, and so forth. If a macro call is seen throughout the expansion of a macro, theassembler starts immediately with the expansion of the called macro. For this, its expanded

    body lines are simply inserted into the expanded macro body of the calling macro, until thecalled macro is completely expanded. Then the expansion of the calling macro is continuedwith the body line following the nested macro call.

    Example:

    INSIDE MACRO

    SUBB A,R3

    ENDM

  • 7/30/2019 Master of Computer Application1

    24/34

    OUTSIDE MACRO

    MOV A,#42

    INSIDE

    MOV R7,AENDM

    In the body of the macro OUTSIDE, the macro ISIDE is called. If OUTSIDE is called (andthe list mode is set to $GENONLY), one gets something like the following expansion:

    Line I Addr Code Source

    15+ 1 0000 74 2A MOV A,#42

    17+ 2 0002 9B SUBB A,R3

    18+ 1 0003 FF MOV R7,A

    Since macro calls can be nested to any depth (while there is free memory), the macroexpansion level is shown in the I-column of the list file. Since macro and include file levelscan be nested in arbitrary sequence and depth, the nesting level is counted through all macroand include file levels regardless. For better distinction, the character following the globalline number is ':' for include file levels, and '+' for macro levels.

    If macros are calling themselves, one speaks of recursive macro calls. In this case, there mustbe some stop criterion, to prevent the macro of calling itself over and over until the assembleris running out of memory! Here again, conditional assembly is the solution:

    Nested Macro Definitions

    A macro body may also contain further macro definitions. However, these nested macrodefinitions aren't valid until the enclosing macro has been